Skip to content

Commit e8fa33a

Browse files
committed
NFSv4/pnfs: Fix an infinite layoutget loop
Since we can now use a lock stateid or a delegation stateid, that differs from the context stateid, we need to change the test in nfs4_layoutget_handle_exception() to take this into account. This fixes an infinite layoutget loop in the NFS client whereby it keeps retrying the initial layoutget using the same broken stateid. Fixes: 70d2f7b ("pNFS: Use the standard I/O stateid when...") Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
1 parent 0a47df1 commit e8fa33a

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

fs/nfs/nfs4proc.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8399,8 +8399,7 @@ nfs4_layoutget_handle_exception(struct rpc_task *task,
83998399
lo = NFS_I(inode)->layout;
84008400
/* If the open stateid was bad, then recover it. */
84018401
if (!lo || test_bit(NFS_LAYOUT_INVALID_STID, &lo->plh_flags) ||
8402-
nfs4_stateid_match_other(&lgp->args.stateid,
8403-
&lgp->args.ctx->state->stateid)) {
8402+
!nfs4_stateid_match_other(&lgp->args.stateid, &lo->plh_stateid)) {
84048403
spin_unlock(&inode->i_lock);
84058404
exception->state = lgp->args.ctx->state;
84068405
exception->stateid = &lgp->args.stateid;

0 commit comments

Comments
 (0)