nfs_do_writepage is a successful return that requires the caller to unlock the folio. Using it here requires special casing both in nfs_do_writepage and nfs_writepages_callback and leaves a land mine in nfs_wb_folio in case it ever set the flag. Remove it and just unconditionally unlock in nfs_writepages_callback. Signed-off-by: Christoph Hellwig <hch@xxxxxx> --- fs/nfs/write.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/fs/nfs/write.c b/fs/nfs/write.c index 048837a9b1ba..3e873c5b1041 100644 --- a/fs/nfs/write.c +++ b/fs/nfs/write.c @@ -662,8 +662,6 @@ static int nfs_do_writepage(struct folio *folio, struct writeback_control *wbc, */ if (nfs_error_is_fatal_on_server(ret)) goto out_launder; - if (wbc->sync_mode == WB_SYNC_NONE) - ret = AOP_WRITEPAGE_ACTIVATE; folio_redirty_for_writepage(wbc, folio); nfs_redirty_request(req); pgio->pg_error = 0; @@ -702,8 +700,7 @@ static int nfs_writepages_callback(struct folio *folio, int ret; ret = nfs_do_writepage(folio, wbc, data); - if (ret != AOP_WRITEPAGE_ACTIVATE) - folio_unlock(folio); + folio_unlock(folio); return ret; } -- 2.47.2