NFS: Allow folio migration for the case of mode == MIGRATE_SYNC

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>
This commit is contained in:
Trond Myklebust
2025-06-24 17:32:09 -04:00
parent b0b7cdc994
commit 72508db0fe

View 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)