aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKinglong Mee <kinglongmee@gmail.com>2015-09-20 11:04:22 -0400
committerTrond Myklebust <trond.myklebust@primarydata.com>2015-09-20 13:46:45 -0400
commit8714d46dc5b95a6a898ec8f1e67237c7995adfc6 (patch)
tree1f5ce5d43a3c699becfd30b5470a29cf4f91c2e8
parent6f29b9bba7b08c6b1d6f2cc4cf750b342fc1946c (diff)
NFS: Fix an infinite loop when layoutget fail with BAD_STATEID
If layouget fail with BAD_STATEID, restart should not using the old stateid. But, nfs client choose the layout stateid at first, and then the open stateid. To avoid the infinite loop of using bad stateid for layoutget, this patch sets the layout flag'ss NFS_LAYOUT_INVALID_STID bit to skip choosing the bad layout stateid. Signed-off-by: Kinglong Mee <kinglongmee@gmail.com> Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
-rw-r--r--fs/nfs/nfs4proc.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 693b903b48bd..10ba6c1968e2 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -7820,6 +7820,7 @@ static void nfs4_layoutget_done(struct rpc_task *task, void *calldata)
7820 * Mark the bad layout state as invalid, then retry 7820 * Mark the bad layout state as invalid, then retry
7821 * with the current stateid. 7821 * with the current stateid.
7822 */ 7822 */
7823 set_bit(NFS_LAYOUT_INVALID_STID, &lo->plh_flags);
7823 pnfs_mark_matching_lsegs_invalid(lo, &head, NULL); 7824 pnfs_mark_matching_lsegs_invalid(lo, &head, NULL);
7824 spin_unlock(&inode->i_lock); 7825 spin_unlock(&inode->i_lock);
7825 pnfs_free_lseg_list(&head); 7826 pnfs_free_lseg_list(&head);