]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
nfs: don't return AOP_WRITEPAGE_ACTIVATE from nfs_do_writepage
authorChristoph Hellwig <hch@lst.de>
Wed, 7 May 2025 04:48:52 +0000 (06:48 +0200)
committerAnna Schumaker <anna.schumaker@oracle.com>
Wed, 28 May 2025 21:17:13 +0000 (17:17 -0400)
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@lst.de>
Signed-off-by: Anna Schumaker <anna.schumaker@oracle.com>
fs/nfs/write.c

index 148e773c3665082bd380d9fab2ac2d85dca675c5..4e1d57b63a85d1b98d1e14b88b6d11d8d014c209 100644 (file)
@@ -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;
 }