NFS/pnfs: handle bad delegation stateids in nfs4_layoutget_handle_exception
We must call nfs4_handle_exception() on BAD_STATEID errors. The only exception is if the stateid argument turns out to be a layout stateid that is declared invalid. Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com> Reviewed-by: Jeff Layton <jlayton@poochiereds.net> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
This commit is contained in:
parent
e5241e4388
commit
dd1beb3d16
1 changed files with 4 additions and 4 deletions
|
@ -7924,8 +7924,8 @@ nfs4_layoutget_handle_exception(struct rpc_task *task,
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
lo = NFS_I(inode)->layout;
|
lo = NFS_I(inode)->layout;
|
||||||
if (lo && nfs4_stateid_match(&lgp->args.stateid,
|
if (lo && !test_bit(NFS_LAYOUT_INVALID_STID, &lo->plh_flags) &&
|
||||||
&lo->plh_stateid)) {
|
nfs4_stateid_match_other(&lgp->args.stateid, &lo->plh_stateid)) {
|
||||||
LIST_HEAD(head);
|
LIST_HEAD(head);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -7936,10 +7936,10 @@ nfs4_layoutget_handle_exception(struct rpc_task *task,
|
||||||
pnfs_mark_matching_lsegs_invalid(lo, &head, NULL, 0);
|
pnfs_mark_matching_lsegs_invalid(lo, &head, NULL, 0);
|
||||||
spin_unlock(&inode->i_lock);
|
spin_unlock(&inode->i_lock);
|
||||||
pnfs_free_lseg_list(&head);
|
pnfs_free_lseg_list(&head);
|
||||||
} else
|
|
||||||
spin_unlock(&inode->i_lock);
|
|
||||||
status = -EAGAIN;
|
status = -EAGAIN;
|
||||||
goto out;
|
goto out;
|
||||||
|
} else
|
||||||
|
spin_unlock(&inode->i_lock);
|
||||||
}
|
}
|
||||||
|
|
||||||
status = nfs4_handle_exception(server, status, exception);
|
status = nfs4_handle_exception(server, status, exception);
|
||||||
|
|
Loading…
Reference in a new issue