diff options
-rw-r--r-- | fs/nfs/pnfs.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c index d4e06b7459f4..9b7e88b7edfc 100644 --- a/fs/nfs/pnfs.c +++ b/fs/nfs/pnfs.c | |||
@@ -1844,7 +1844,10 @@ pnfs_layout_process(struct nfs4_layoutget *lgp) | |||
1844 | goto out_forget; | 1844 | goto out_forget; |
1845 | } | 1845 | } |
1846 | 1846 | ||
1847 | if (nfs4_stateid_match_other(&lo->plh_stateid, &res->stateid)) { | 1847 | if (!pnfs_layout_is_valid(lo)) { |
1848 | /* We have a completely new layout */ | ||
1849 | pnfs_set_layout_stateid(lo, &res->stateid, true); | ||
1850 | } else if (nfs4_stateid_match_other(&lo->plh_stateid, &res->stateid)) { | ||
1848 | /* existing state ID, make sure the sequence number matches. */ | 1851 | /* existing state ID, make sure the sequence number matches. */ |
1849 | if (pnfs_layout_stateid_blocked(lo, &res->stateid)) { | 1852 | if (pnfs_layout_stateid_blocked(lo, &res->stateid)) { |
1850 | dprintk("%s forget reply due to sequence\n", __func__); | 1853 | dprintk("%s forget reply due to sequence\n", __func__); |
@@ -1854,12 +1857,10 @@ pnfs_layout_process(struct nfs4_layoutget *lgp) | |||
1854 | } else { | 1857 | } else { |
1855 | /* | 1858 | /* |
1856 | * We got an entirely new state ID. Mark all segments for the | 1859 | * We got an entirely new state ID. Mark all segments for the |
1857 | * inode invalid, and don't bother validating the stateid | 1860 | * inode invalid, and retry the layoutget |
1858 | * sequence number. | ||
1859 | */ | 1861 | */ |
1860 | pnfs_mark_layout_stateid_invalid(lo, &free_me); | 1862 | pnfs_mark_layout_stateid_invalid(lo, &free_me); |
1861 | 1863 | goto out_forget; | |
1862 | pnfs_set_layout_stateid(lo, &res->stateid, true); | ||
1863 | } | 1864 | } |
1864 | 1865 | ||
1865 | pnfs_get_lseg(lseg); | 1866 | pnfs_get_lseg(lseg); |