aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/write.c
diff options
context:
space:
mode:
authorChristoph Hellwig <[email protected]>2025-05-07 04:48:52 +0000
committerAnna Schumaker <[email protected]>2025-05-28 21:17:13 +0000
commit66beed5acaf27137007459e7e53bf8d6f1b799cc (patch)
tree413a8f978bb0e053f93d26f2a390750af4252b78 /fs/nfs/write.c
parentnfs: fold nfs_page_async_flush into nfs_do_writepage (diff)
downloadkernel-66beed5acaf27137007459e7e53bf8d6f1b799cc.tar.gz
kernel-66beed5acaf27137007459e7e53bf8d6f1b799cc.zip
nfs: don't return AOP_WRITEPAGE_ACTIVATE from nfs_do_writepage
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 <[email protected]> Signed-off-by: Anna Schumaker <[email protected]>
Diffstat (limited to 'fs/nfs/write.c')
-rw-r--r--fs/nfs/write.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/fs/nfs/write.c b/fs/nfs/write.c
index 148e773c3665..4e1d57b63a85 100644
--- a/fs/nfs/write.c
+++ b/fs/nfs/write.c
@@ -663,8 +663,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;
@@ -703,8 +701,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;
}