Skip to content

Commit

Permalink
pnfs: fix bad error handling in send_layoutget
Browse files Browse the repository at this point in the history
Currently, the code will clear the fail bit if we get back a fatal
error. I don't think that's correct -- we want to clear that bit
if we do not get a fatal error.

Fixes: 0bcbf03 (nfs: handle request add failure properly)
Signed-off-by: Jeff Layton <jeff.layton@primarydata.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
  • Loading branch information
Jeff Layton authored and Anna Schumaker committed May 17, 2016
1 parent 95e2b7e commit d03ab29
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions fs/nfs/pnfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -876,11 +876,16 @@ send_layoutget(struct pnfs_layout_hdr *lo,
lseg = nfs4_proc_layoutget(lgp, gfp_flags);
} while (lseg == ERR_PTR(-EAGAIN));

if (IS_ERR(lseg) && !nfs_error_is_fatal(PTR_ERR(lseg)))
lseg = NULL;
else
if (IS_ERR(lseg)) {
if (!nfs_error_is_fatal(PTR_ERR(lseg))) {
pnfs_layout_clear_fail_bit(lo,
pnfs_iomode_to_fail_bit(range->iomode));
lseg = NULL;
}
} else {
pnfs_layout_clear_fail_bit(lo,
pnfs_iomode_to_fail_bit(range->iomode));
}

return lseg;
}
Expand Down

0 comments on commit d03ab29

Please sign in to comment.