diff options
author | Jeff Layton <jlayton@poochiereds.net> | 2016-05-17 12:28:45 -0400 |
---|---|---|
committer | Anna Schumaker <Anna.Schumaker@Netapp.com> | 2016-05-17 15:48:11 -0400 |
commit | d03ab29dbbe905c6c7c5abd78e02547fa954ec07 (patch) | |
tree | 290ac16ad003538b28b47514c0e29b9e49fd559d | |
parent | 95e2b7e95d43c5c95620b12355a90713268376d3 (diff) |
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 <jeff.layton@primarydata.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
-rw-r--r-- | fs/nfs/pnfs.c | 11 |
1 files changed, 8 insertions, 3 deletions
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, | |||
876 | lseg = nfs4_proc_layoutget(lgp, gfp_flags); | 876 | lseg = nfs4_proc_layoutget(lgp, gfp_flags); |
877 | } while (lseg == ERR_PTR(-EAGAIN)); | 877 | } while (lseg == ERR_PTR(-EAGAIN)); |
878 | 878 | ||
879 | if (IS_ERR(lseg) && !nfs_error_is_fatal(PTR_ERR(lseg))) | 879 | if (IS_ERR(lseg)) { |
880 | lseg = NULL; | 880 | if (!nfs_error_is_fatal(PTR_ERR(lseg))) { |
881 | else | 881 | pnfs_layout_clear_fail_bit(lo, |
882 | pnfs_iomode_to_fail_bit(range->iomode)); | ||
883 | lseg = NULL; | ||
884 | } | ||
885 | } else { | ||
882 | pnfs_layout_clear_fail_bit(lo, | 886 | pnfs_layout_clear_fail_bit(lo, |
883 | pnfs_iomode_to_fail_bit(range->iomode)); | 887 | pnfs_iomode_to_fail_bit(range->iomode)); |
888 | } | ||
884 | 889 | ||
885 | return lseg; | 890 | return lseg; |
886 | } | 891 | } |