Skip to content

Commit

Permalink
pnfs: don't merge new ff lsegs with ones that have LAYOUTRETURN bit set
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jeff Layton authored and Anna Schumaker committed May 17, 2016
1 parent 446ca21 commit ee26bdd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fs/nfs/flexfilelayout/flexfilelayout.c
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,8 @@ ff_lseg_merge(struct pnfs_layout_segment *new,
{
u64 new_end, old_end;

if (test_bit(NFS_LSEG_LAYOUTRETURN, &old->pls_flags))
return false;
if (new->pls_range.iomode != old->pls_range.iomode)
return false;
old_end = pnfs_calc_offset_end(old->pls_range.offset,
Expand All @@ -319,8 +321,6 @@ ff_lseg_merge(struct pnfs_layout_segment *new,
new_end);
if (test_bit(NFS_LSEG_ROC, &old->pls_flags))
set_bit(NFS_LSEG_ROC, &new->pls_flags);
if (test_bit(NFS_LSEG_LAYOUTRETURN, &old->pls_flags))
set_bit(NFS_LSEG_LAYOUTRETURN, &new->pls_flags);
return true;
}

Expand Down

0 comments on commit ee26bdd

Please sign in to comment.