]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
NFS: Allow folio migration for the case of mode == MIGRATE_SYNC
authorTrond Myklebust <trond.myklebust@hammerspace.com>
Tue, 24 Jun 2025 21:32:09 +0000 (17:32 -0400)
committerTrond Myklebust <trond.myklebust@hammerspace.com>
Mon, 14 Jul 2025 22:20:27 +0000 (15:20 -0700)
When the mode is MIGRATE_SYNC, we are allowed to call nfs_wb_folio()
under the folio lock.

Reviewed-by: Benjamin Coddington <bcodding@redhat.com>
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
fs/nfs/write.c

index 374fc6b34c7954ef781026e5114cf5411f366ecd..0dd22983f0d017c7fd6180e4a862dad802a08e24 100644 (file)
@@ -2113,8 +2113,12 @@ int nfs_migrate_folio(struct address_space *mapping, struct folio *dst,
         *        that we can safely release the inode reference while holding
         *        the folio lock.
         */
-       if (folio_test_private(src))
-               return -EBUSY;
+       if (folio_test_private(src)) {
+               if (mode == MIGRATE_SYNC)
+                       nfs_wb_folio(src->mapping->host, src);
+               if (folio_test_private(src))
+                       return -EBUSY;
+       }
 
        if (folio_test_private_2(src)) { /* [DEPRECATED] */
                if (mode == MIGRATE_ASYNC)