aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
Diffstat (limited to 'fs')
-rw-r--r--fs/nfs/pnfs.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c
index f1387e87513f..de827251bdac 100644
--- a/fs/nfs/pnfs.c
+++ b/fs/nfs/pnfs.c
@@ -572,7 +572,7 @@ pnfs_set_layout_stateid(struct pnfs_layout_hdr *lo, const nfs4_stateid *new,
572 if (update_barrier) { 572 if (update_barrier) {
573 u32 new_barrier = be32_to_cpu(new->seqid); 573 u32 new_barrier = be32_to_cpu(new->seqid);
574 574
575 if ((int)(new_barrier - lo->plh_barrier)) 575 if (pnfs_seqid_is_newer(new_barrier, lo->plh_barrier))
576 lo->plh_barrier = new_barrier; 576 lo->plh_barrier = new_barrier;
577 } else { 577 } else {
578 /* Because of wraparound, we want to keep the barrier 578 /* Because of wraparound, we want to keep the barrier
@@ -593,9 +593,12 @@ static bool
593pnfs_layoutgets_blocked(struct pnfs_layout_hdr *lo, nfs4_stateid *stateid, 593pnfs_layoutgets_blocked(struct pnfs_layout_hdr *lo, nfs4_stateid *stateid,
594 int lget) 594 int lget)
595{ 595{
596 if ((stateid) && 596 if (stateid != NULL) {
597 (int)(lo->plh_barrier - be32_to_cpu(stateid->seqid)) >= 0) 597 u32 seqid = be32_to_cpu(stateid->seqid);
598 return true; 598
599 if (!pnfs_seqid_is_newer(seqid, lo->plh_barrier))
600 return true;
601 }
599 return lo->plh_block_lgets || 602 return lo->plh_block_lgets ||
600 test_bit(NFS_LAYOUT_BULK_RECALL, &lo->plh_flags) || 603 test_bit(NFS_LAYOUT_BULK_RECALL, &lo->plh_flags) ||
601 (list_empty(&lo->plh_segs) && 604 (list_empty(&lo->plh_segs) &&