From: Oleg Drokin Date: Thu, 12 Jun 2014 23:13:25 +0000 (-0400) Subject: LU-5188 osp: Correctly check for invalid setattr record X-Git-Tag: 2.6.0-RC1~60 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=79dd530f1352e6b57fcb870a1e0f2c2a05a0648d LU-5188 osp: Correctly check for invalid setattr record 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 Reviewed-on: http://review.whamcloud.com/10706 Tested-by: Jenkins Reviewed-by: John L. Hammond Reviewed-by: Mike Pershin Tested-by: Maloo Reviewed-by: Andreas Dilger --- diff --git a/lustre/osp/osp_sync.c b/lustre/osp/osp_sync.c index 34a0e2c..1dd8e85 100644 --- a/lustre/osp/osp_sync.c +++ b/lustre/osp/osp_sync.c @@ -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 */ - 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); - 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);