staging: lustre: include: fix one off errors in lustre_id.h
authorJames Simmons <jsimmons@infradead.org>
Tue, 16 Aug 2016 20:19:23 +0000 (16:19 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 21 Aug 2016 13:57:38 +0000 (15:57 +0200)
During inspection of another patch Dan Carpenter noticed some
one off errors in lustre_id.h. Fix the condition test for
OBIF_MAX_OID.

Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/lustre/include/lustre/lustre_idl.h

index 17581bac3a370c9ef39ef905b0e395ae644c102e..95454510a212f75157dffd14ead789d83554e9ce 100644 (file)
@@ -659,7 +659,7 @@ static inline void ostid_set_id(struct ost_id *oi, __u64 oid)
                oi->oi_fid.f_oid = oid;
                oi->oi_fid.f_ver = oid >> 48;
        } else {
-               if (oid > OBIF_MAX_OID) {
+               if (oid >= OBIF_MAX_OID) {
                        CERROR("Bad %llu to set " DOSTID "\n", oid, POSTID(oi));
                        return;
                }
@@ -684,7 +684,7 @@ static inline int fid_set_id(struct lu_fid *fid, __u64 oid)
                fid->f_oid = oid;
                fid->f_ver = oid >> 48;
        } else {
-               if (oid > OBIF_MAX_OID) {
+               if (oid >= OBIF_MAX_OID) {
                        CERROR("Too large OID %#llx to set REG "DFID"\n",
                               (unsigned long long)oid, PFID(fid));
                        return -EBADF;