diff options
author | Trond Myklebust <trond.myklebust@primarydata.com> | 2016-11-14 14:34:18 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-01-09 02:32:24 -0500 |
commit | e523ce8c99f9bbd530fda7d46c35409fee88a50f (patch) | |
tree | f9fbaa211921aa7dc7f911baedb7c63f89ca772a /fs | |
parent | f32659df6e154b40391afe7a5db3f0879ad6e70a (diff) |
pNFS: Clear NFS_LAYOUT_RETURN_REQUESTED when invalidating the layout stateid
commit ae5a459d5f65c3e83f3e14068dde5fb9c9d81807 upstream.
We must ensure that we don't schedule a layoutreturn if the layout stateid
has been marked as invalid.
Fixes: 2a59a0411671e ("pNFS: Fix pnfs_set_layout_stateid() to clear...")
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/nfs/pnfs.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c index 106dee9dca34..a106f709c1a7 100644 --- a/fs/nfs/pnfs.c +++ b/fs/nfs/pnfs.c | |||
@@ -299,6 +299,14 @@ pnfs_put_layout_hdr(struct pnfs_layout_hdr *lo) | |||
299 | } | 299 | } |
300 | } | 300 | } |
301 | 301 | ||
302 | static void | ||
303 | pnfs_clear_layoutreturn_info(struct pnfs_layout_hdr *lo) | ||
304 | { | ||
305 | lo->plh_return_iomode = 0; | ||
306 | lo->plh_return_seq = 0; | ||
307 | clear_bit(NFS_LAYOUT_RETURN_REQUESTED, &lo->plh_flags); | ||
308 | } | ||
309 | |||
302 | /* | 310 | /* |
303 | * Mark a pnfs_layout_hdr and all associated layout segments as invalid | 311 | * Mark a pnfs_layout_hdr and all associated layout segments as invalid |
304 | * | 312 | * |
@@ -317,6 +325,7 @@ pnfs_mark_layout_stateid_invalid(struct pnfs_layout_hdr *lo, | |||
317 | }; | 325 | }; |
318 | 326 | ||
319 | set_bit(NFS_LAYOUT_INVALID_STID, &lo->plh_flags); | 327 | set_bit(NFS_LAYOUT_INVALID_STID, &lo->plh_flags); |
328 | pnfs_clear_layoutreturn_info(lo); | ||
320 | return pnfs_mark_matching_lsegs_invalid(lo, lseg_list, &range, 0); | 329 | return pnfs_mark_matching_lsegs_invalid(lo, lseg_list, &range, 0); |
321 | } | 330 | } |
322 | 331 | ||
@@ -818,14 +827,6 @@ pnfs_destroy_all_layouts(struct nfs_client *clp) | |||
818 | pnfs_destroy_layouts_byclid(clp, false); | 827 | pnfs_destroy_layouts_byclid(clp, false); |
819 | } | 828 | } |
820 | 829 | ||
821 | static void | ||
822 | pnfs_clear_layoutreturn_info(struct pnfs_layout_hdr *lo) | ||
823 | { | ||
824 | lo->plh_return_iomode = 0; | ||
825 | lo->plh_return_seq = 0; | ||
826 | clear_bit(NFS_LAYOUT_RETURN_REQUESTED, &lo->plh_flags); | ||
827 | } | ||
828 | |||
829 | /* update lo->plh_stateid with new if is more recent */ | 830 | /* update lo->plh_stateid with new if is more recent */ |
830 | void | 831 | void |
831 | pnfs_set_layout_stateid(struct pnfs_layout_hdr *lo, const nfs4_stateid *new, | 832 | pnfs_set_layout_stateid(struct pnfs_layout_hdr *lo, const nfs4_stateid *new, |