]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
NFS: Fix an infinite loop when layoutget fail with BAD_STATEID
authorKinglong Mee <kinglongmee@gmail.com>
Sun, 20 Sep 2015 15:04:22 +0000 (23:04 +0800)
committerTrond Myklebust <trond.myklebust@primarydata.com>
Sun, 20 Sep 2015 17:46:45 +0000 (13:46 -0400)
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>
fs/nfs/nfs4proc.c

index 693b903b48bdfb78808274e90f53971eb1f21244..10ba6c1968e2110eba30488f7dc75230cf481ba8 100644 (file)
@@ -7820,6 +7820,7 @@ static void nfs4_layoutget_done(struct rpc_task *task, void *calldata)
                         * Mark the bad layout state as invalid, then retry
                         * with the current stateid.
                         */
+                       set_bit(NFS_LAYOUT_INVALID_STID, &lo->plh_flags);
                        pnfs_mark_matching_lsegs_invalid(lo, &head, NULL);
                        spin_unlock(&inode->i_lock);
                        pnfs_free_lseg_list(&head);