Whamcloud - gitweb
LU-5188 osp: Correctly check for invalid setattr record 06/10706/3
authorOleg Drokin <oleg.drokin@intel.com>
Thu, 12 Jun 2014 23:13:25 +0000 (19:13 -0400)
committerOleg Drokin <oleg.drokin@intel.com>
Fri, 20 Jun 2014 17:56:16 +0000 (17:56 +0000)
Patch for LU-4345 (commit 80f90fcde73e2faff8b7b0ffc7c19bc52982e027 )
has a correct comment about lsr_valid member being either 0 or
having UID and GID fields set, but the check has a typo causing
it to check for lsr_valid to be both 0 and have the bits set which
is impossible.

The osp_sync_new_setattr_job() should return 0 for invalid record,
so that sync thread can continue processing on other records.

Change-Id: I32e6f261b4707391d6e96f8434aae7bf8f55bf8e
Signed-off-by: Oleg Drokin <oleg.drokin@intel.com>
Reviewed-on: http://review.whamcloud.com/10706
Tested-by: Jenkins
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Mike Pershin <mike.pershin@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
lustre/osp/osp_sync.c

index 34a0e2c..1dd8e85 100644 (file)
@@ -484,10 +484,12 @@ static int osp_sync_new_setattr_job(struct osp_device *d,
        LASSERT(h->lrh_type == MDS_SETATTR64_REC);
 
        /* lsr_valid can only be 0 or LA_UID/GID set */
        LASSERT(h->lrh_type == MDS_SETATTR64_REC);
 
        /* lsr_valid can only be 0 or LA_UID/GID set */
-       if (!rec->lsr_valid && !(rec->lsr_valid & ~(LA_UID | LA_GID))) {
+       if ((rec->lsr_valid & ~(LA_UID | LA_GID)) != 0) {
                CERROR("%s: invalid setattr record, lsr_valid:"LPU64"\n",
                       d->opd_obd->obd_name, rec->lsr_valid);
                CERROR("%s: invalid setattr record, lsr_valid:"LPU64"\n",
                       d->opd_obd->obd_name, rec->lsr_valid);
-               RETURN(-EINVAL);
+               /* return 0 so that sync thread can continue processing
+                * other records. */
+               RETURN(0);
        }
 
        req = osp_sync_new_job(d, llh, h, OST_SETATTR, &RQF_OST_SETATTR);
        }
 
        req = osp_sync_new_job(d, llh, h, OST_SETATTR, &RQF_OST_SETATTR);