From 37b7b70ead5535020ffc22b5c21ec5622134ac9e Mon Sep 17 00:00:00 2001 From: Trond Myklebust Date: Tue, 2 Oct 2012 16:56:49 -0700 Subject: [PATCH] --- yaml --- r: 333213 b: refs/heads/master c: 25a1a6211dd2fcbf0e45a07030703e2a42d7aa87 h: refs/heads/master i: 333211: 50ff7d69266e9b60bdd0ca65d42be5dcee57c150 v: v3 --- [refs] | 2 +- trunk/fs/nfs/pnfs.c | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/[refs] b/[refs] index 52c3404655c5..7cee442e9e3a 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 5a65503f3dbdb4aa1cd6cb58c479c015d093292b +refs/heads/master: 25a1a6211dd2fcbf0e45a07030703e2a42d7aa87 diff --git a/trunk/fs/nfs/pnfs.c b/trunk/fs/nfs/pnfs.c index f1387e87513f..de827251bdac 100644 --- a/trunk/fs/nfs/pnfs.c +++ b/trunk/fs/nfs/pnfs.c @@ -572,7 +572,7 @@ pnfs_set_layout_stateid(struct pnfs_layout_hdr *lo, const nfs4_stateid *new, if (update_barrier) { u32 new_barrier = be32_to_cpu(new->seqid); - if ((int)(new_barrier - lo->plh_barrier)) + if (pnfs_seqid_is_newer(new_barrier, lo->plh_barrier)) lo->plh_barrier = new_barrier; } else { /* Because of wraparound, we want to keep the barrier @@ -593,9 +593,12 @@ static bool pnfs_layoutgets_blocked(struct pnfs_layout_hdr *lo, nfs4_stateid *stateid, int lget) { - if ((stateid) && - (int)(lo->plh_barrier - be32_to_cpu(stateid->seqid)) >= 0) - return true; + if (stateid != NULL) { + u32 seqid = be32_to_cpu(stateid->seqid); + + if (!pnfs_seqid_is_newer(seqid, lo->plh_barrier)) + return true; + } return lo->plh_block_lgets || test_bit(NFS_LAYOUT_BULK_RECALL, &lo->plh_flags) || (list_empty(&lo->plh_segs) &&