SUNRPC: Allow waiting on memory allocation
authorTrond Myklebust <trond.myklebust@primarydata.com>
Fri, 23 Jan 2015 19:50:56 +0000 (14:50 -0500)
committerTrond Myklebust <trond.myklebust@primarydata.com>
Sat, 24 Jan 2015 23:46:50 +0000 (18:46 -0500)
We should be safe now, as long as we don't do GFP_IO or higher allocations

Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
net/sunrpc/sched.c

index 4f65ec28d2b49c39553d753272e53cf7c4aeb879..b91fd9c597b45158cc9ce88a8fb4caa5130faf96 100644 (file)
@@ -844,10 +844,10 @@ static void rpc_async_schedule(struct work_struct *work)
 void *rpc_malloc(struct rpc_task *task, size_t size)
 {
        struct rpc_buffer *buf;
-       gfp_t gfp = GFP_NOWAIT | __GFP_NOWARN;
+       gfp_t gfp = GFP_NOIO | __GFP_NOWARN;
 
        if (RPC_IS_SWAPPER(task))
-               gfp |= __GFP_MEMALLOC;
+               gfp = __GFP_MEMALLOC | GFP_NOWAIT | __GFP_NOWARN;
 
        size += sizeof(struct rpc_buffer);
        if (size <= RPC_BUFFER_MAXSIZE)