Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d03ab29d authored by Jeff Layton's avatar Jeff Layton Committed by Anna Schumaker
Browse files

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: 0bcbf039 (nfs: handle request add failure properly)
Signed-off-by: default avatarJeff Layton <jeff.layton@primarydata.com>
Signed-off-by: default avatarAnna Schumaker <Anna.Schumaker@Netapp.com>
parent 95e2b7e9
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -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)))
	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
		}
	} else {
		pnfs_layout_clear_fail_bit(lo,
				pnfs_iomode_to_fail_bit(range->iomode));
	}

	return lseg;
}