Skip to content

Commit

Permalink
NFSv4/pnfs: The layout barrier indicate a minimal value for the seqid
Browse files Browse the repository at this point in the history
The intention of the layout barrier is to ensure that we do not update
the layout to match an older value than the current expectation. Fix the
test in pnfs_layout_stateid_blocked() to reflect that it is legal for
the seqid of the stateid to match that of the barrier.

Fixes: aa95edf ("NFSv4/pnfs: Fix the layout barrier update")
Signed-off-by: Trond Myklebust <[email protected]>
Signed-off-by: Anna Schumaker <[email protected]>
  • Loading branch information
Trond Myklebust authored and amschuma-ntap committed Aug 9, 2021
1 parent 45baada commit d6236a9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/nfs/pnfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1000,7 +1000,7 @@ pnfs_layout_stateid_blocked(const struct pnfs_layout_hdr *lo,
{
u32 seqid = be32_to_cpu(stateid->seqid);

return !pnfs_seqid_is_newer(seqid, lo->plh_barrier) && lo->plh_barrier;
return lo->plh_barrier && pnfs_seqid_is_newer(lo->plh_barrier, seqid);
}

/* lget is set to 1 if called from inside send_layoutget call chain */
Expand Down

0 comments on commit d6236a9

Please sign in to comment.