OSDN Git Service

pNFS/files: Ensure pNFS allocation modes are consistent with nfsiod
authorTrond Myklebust <trond.myklebust@hammerspace.com>
Mon, 21 Mar 2022 21:27:14 +0000 (17:27 -0400)
committerTrond Myklebust <trond.myklebust@hammerspace.com>
Tue, 22 Mar 2022 19:52:56 +0000 (15:52 -0400)
Ensure that pNFS file commit allocations in rpciod/nfsiod callbacks can
fail in low memory mode, so that the threads don't block and loop
forever.

Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
fs/nfs/filelayout/filelayout.c

index 9c96e3e..76dedda 100644 (file)
@@ -1075,7 +1075,7 @@ filelayout_setup_ds_info(struct pnfs_ds_commit_info *fl_cinfo,
        unsigned int size = (fl->stripe_type == STRIPE_SPARSE) ?
                fl->dsaddr->ds_num : fl->dsaddr->stripe_count;
 
-       new = pnfs_alloc_commit_array(size, GFP_NOIO);
+       new = pnfs_alloc_commit_array(size, nfs_io_gfp_mask());
        if (new) {
                spin_lock(&inode->i_lock);
                array = pnfs_add_commit_array(fl_cinfo, new, lseg);