From: Jeff Layton Date: Tue, 17 May 2016 16:28:45 +0000 (-0400) Subject: pnfs: fix bad error handling in send_layoutget X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=d03ab29dbbe905c6c7c5abd78e02547fa954ec07;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git pnfs: fix bad error handling in send_layoutget 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: 0bcbf039f6 (nfs: handle request add failure properly) Signed-off-by: Jeff Layton Signed-off-by: Anna Schumaker --- diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c index 21ff53fe7a9e..e3e9973b5f76 100644 --- a/fs/nfs/pnfs.c +++ b/fs/nfs/pnfs.c @@ -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; }