Skip to content

Commit

Permalink
NFSv4/pnfs: Handle RPC allocation errors in nfs4_proc_layoutget
Browse files Browse the repository at this point in the history
If rpc_run_task() fails due to an allocation error, then bail out early.

Fixes: 910ad38 ("NFS: Fix memory allocation in rpc_alloc_task()")
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
  • Loading branch information
Trond Myklebust committed Apr 7, 2022
1 parent 9d82819 commit 68b78dc
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions fs/nfs/nfs4proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -9615,6 +9615,8 @@ nfs4_proc_layoutget(struct nfs4_layoutget *lgp, long *timeout)
nfs4_init_sequence(&lgp->args.seq_args, &lgp->res.seq_res, 0, 0);

task = rpc_run_task(&task_setup_data);
if (IS_ERR(task))
return ERR_CAST(task);

status = rpc_wait_for_completion_task(task);
if (status != 0)
Expand Down

0 comments on commit 68b78dc

Please sign in to comment.