NFSv4.1: pnfs_send_layoutreturn should use GFP_NOFS
authorTrond Myklebust <trond.myklebust@primarydata.com>
Thu, 5 Feb 2015 22:05:08 +0000 (17:05 -0500)
committerTrond Myklebust <trond.myklebust@primarydata.com>
Fri, 6 Feb 2015 03:16:50 +0000 (22:16 -0500)
In we want to be able to call pnfs_send_layoutreturn() from within the
writeback path, we really want it to use GFP_NOFS in order to prevent
recursion.

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

index 703501d3ed196f92786ecc236f704843417e1f91..a1d8620e8cb7c8f8bec0dc175b4f81cb337a1836 100644 (file)
@@ -948,7 +948,7 @@ pnfs_send_layoutreturn(struct pnfs_layout_hdr *lo, nfs4_stateid stateid,
        struct nfs4_layoutreturn *lrp;
        int status = 0;
 
-       lrp = kzalloc(sizeof(*lrp), GFP_KERNEL);
+       lrp = kzalloc(sizeof(*lrp), GFP_NOFS);
        if (unlikely(lrp == NULL)) {
                status = -ENOMEM;
                spin_lock(&ino->i_lock);