aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Layton <jlayton@poochiereds.net>2016-05-17 12:28:39 -0400
committerAnna Schumaker <Anna.Schumaker@Netapp.com>2016-05-17 15:48:09 -0400
commitee26bdd680aa10df628499fe95a7b88345574248 (patch)
treedd2339019779eed74a06419c65dd563ee9359cd9
parent446ca2195303c550b1cec7dcf9a478910dc84672 (diff)
pnfs: don't merge new ff lsegs with ones that have LAYOUTRETURN bit set
Otherwise, we'll end up returning layouts that we've just received if the client issues a new LAYOUTGET prior to the LAYOUTRETURN. Signed-off-by: Jeff Layton <jeff.layton@primarydata.com> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
-rw-r--r--fs/nfs/flexfilelayout/flexfilelayout.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/nfs/flexfilelayout/flexfilelayout.c b/fs/nfs/flexfilelayout/flexfilelayout.c
index 2911ceda8cd9..3bac2094c175 100644
--- a/fs/nfs/flexfilelayout/flexfilelayout.c
+++ b/fs/nfs/flexfilelayout/flexfilelayout.c
@@ -299,6 +299,8 @@ ff_lseg_merge(struct pnfs_layout_segment *new,
299{ 299{
300 u64 new_end, old_end; 300 u64 new_end, old_end;
301 301
302 if (test_bit(NFS_LSEG_LAYOUTRETURN, &old->pls_flags))
303 return false;
302 if (new->pls_range.iomode != old->pls_range.iomode) 304 if (new->pls_range.iomode != old->pls_range.iomode)
303 return false; 305 return false;
304 old_end = pnfs_calc_offset_end(old->pls_range.offset, 306 old_end = pnfs_calc_offset_end(old->pls_range.offset,
@@ -319,8 +321,6 @@ ff_lseg_merge(struct pnfs_layout_segment *new,
319 new_end); 321 new_end);
320 if (test_bit(NFS_LSEG_ROC, &old->pls_flags)) 322 if (test_bit(NFS_LSEG_ROC, &old->pls_flags))
321 set_bit(NFS_LSEG_ROC, &new->pls_flags); 323 set_bit(NFS_LSEG_ROC, &new->pls_flags);
322 if (test_bit(NFS_LSEG_LAYOUTRETURN, &old->pls_flags))
323 set_bit(NFS_LSEG_LAYOUTRETURN, &new->pls_flags);
324 return true; 324 return true;
325} 325}
326 326