Skip to content

Commit 66beed5

Browse files
Christoph HellwigAnna Schumaker
authored andcommitted
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]>
1 parent b6354e6 commit 66beed5

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

fs/nfs/write.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -663,8 +663,6 @@ static int nfs_do_writepage(struct folio *folio, struct writeback_control *wbc,
663663
*/
664664
if (nfs_error_is_fatal_on_server(ret))
665665
goto out_launder;
666-
if (wbc->sync_mode == WB_SYNC_NONE)
667-
ret = AOP_WRITEPAGE_ACTIVATE;
668666
folio_redirty_for_writepage(wbc, folio);
669667
nfs_redirty_request(req);
670668
pgio->pg_error = 0;
@@ -703,8 +701,7 @@ static int nfs_writepages_callback(struct folio *folio,
703701
int ret;
704702

705703
ret = nfs_do_writepage(folio, wbc, data);
706-
if (ret != AOP_WRITEPAGE_ACTIVATE)
707-
folio_unlock(folio);
704+
folio_unlock(folio);
708705
return ret;
709706
}
710707

0 commit comments

Comments
 (0)