From: Oleg Drokin Date: Tue, 23 Apr 2013 17:57:16 +0000 (-0400) Subject: Revert "LU-2459 osd: add LMA incompat flag check" X-Git-Tag: 2.3.65~72 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=a585b03a36e61b9039f87135e1542094ae0d6e28 Revert "LU-2459 osd: add LMA incompat flag check" This reverts commit 9ee6e92bcf4a142e76e27d5b8ac8b34684749002. This disrubptively broke maloo testing, unfortunately --- diff --git a/lustre/include/obd_support.h b/lustre/include/obd_support.h index ce2f808..06396a0 100644 --- a/lustre/include/obd_support.h +++ b/lustre/include/obd_support.h @@ -264,8 +264,6 @@ int obd_alloc_fail(const void *ptr, const char *name, const char *type, #define OBD_FAIL_OSD_SCRUB_FATAL 0x192 #define OBD_FAIL_OSD_FID_MAPPING 0x193 -#define OBD_FAIL_OSD_LMA_INCOMPAT 0x194 - #define OBD_FAIL_OST 0x200 #define OBD_FAIL_OST_CONNECT_NET 0x201 #define OBD_FAIL_OST_DISCONNECT_NET 0x202 diff --git a/lustre/osd-ldiskfs/osd_handler.c b/lustre/osd-ldiskfs/osd_handler.c index 6d86a0c..fe8dc3c 100644 --- a/lustre/osd-ldiskfs/osd_handler.c +++ b/lustre/osd-ldiskfs/osd_handler.c @@ -451,35 +451,6 @@ static void osd_object_init0(struct osd_object *obj) (LOHA_EXISTS | (obj->oo_inode->i_mode & S_IFMT)); } -static int osd_check_lma(const struct lu_env *env, struct osd_object *obj) -{ - struct osd_thread_info *info = osd_oti_get(env); - struct lustre_mdt_attrs *lma = &info->oti_mdt_attrs; - int rc; - ENTRY; - - rc = __osd_xattr_get(obj->oo_inode, &info->oti_obj_dentry, - XATTR_NAME_LMA, (void *)lma, sizeof(*lma)); - if (rc > 0) { - rc = 0; - if (unlikely((le32_to_cpu(lma->lma_incompat) & - ~LMA_INCOMPAT_SUPP) || - CFS_FAIL_CHECK(OBD_FAIL_OSD_LMA_INCOMPAT))) { - CWARN("%s: unsupported incompat LMA feature(s) %#x for " - DFID"\n", osd_obj2dev(obj)->od_svname, - le32_to_cpu(lma->lma_incompat) & - ~LMA_INCOMPAT_SUPP, - PFID(lu_object_fid(&obj->oo_dt.do_lu))); - rc = -EOPNOTSUPP; - } - } else if (rc == -ENODATA) { - /* haven't initialize LMA xattr */ - rc = 0; - } - - RETURN(rc); -} - /* * Concurrency: no concurrent access is possible that early in object * life-cycle. @@ -500,10 +471,8 @@ static int osd_object_init(const struct lu_env *env, struct lu_object *l, result = osd_fid_lookup(env, obj, lu_object_fid(l), conf); obj->oo_dt.do_body_ops = &osd_body_ops_new; - if (result == 0 && obj->oo_inode != NULL) { + if (result == 0 && obj->oo_inode != NULL) osd_object_init0(obj); - result = osd_check_lma(env, obj); - } LINVRNT(osd_invariant(obj)); return result; diff --git a/lustre/osd-zfs/osd_object.c b/lustre/osd-zfs/osd_object.c index 978aec7..97f954d 100644 --- a/lustre/osd-zfs/osd_object.c +++ b/lustre/osd-zfs/osd_object.c @@ -349,38 +349,6 @@ int osd_object_init0(const struct lu_env *env, struct osd_object *obj) RETURN(0); } -static int osd_check_lma(const struct lu_env *env, struct osd_object *obj) -{ - struct lu_buf buf; - int rc; - struct lustre_mdt_attrs *lma; - ENTRY; - - lma = (struct lustre_mdt_attrs *)osd_oti_get(env)->oti_buf; - buf.lb_buf = lma; - buf.lb_len = sizeof(*lma); - - rc = osd_xattr_get(env, &obj->oo_dt, &buf, XATTR_NAME_LMA, BYPASS_CAPA); - if (rc > 0) { - rc = 0; - if (unlikely((le32_to_cpu(lma->lma_incompat) & - ~LMA_INCOMPAT_SUPP) || - CFS_FAIL_CHECK(OBD_FAIL_OSD_LMA_INCOMPAT))) { - CWARN("%s: unsupported incompat LMA feature(s) %#x for " - DFID"\n", osd_obj2dev(obj)->od_svname, - le32_to_cpu(lma->lma_incompat) & - ~LMA_INCOMPAT_SUPP, - PFID(lu_object_fid(&obj->oo_dt.do_lu))); - rc = -EOPNOTSUPP; - } - } else if (rc == -ENODATA) { - /* haven't initialize LMA xattr */ - rc = 0; - } - - RETURN(rc); -} - /* * Concurrency: no concurrent access is possible that early in object * life-cycle. @@ -407,24 +375,17 @@ static int osd_object_init(const struct lu_env *env, struct lu_object *l, LASSERT(obj->oo_db == NULL); rc = __osd_obj2dbuf(env, osd->od_objset.os, oid, &obj->oo_db, osd_obj_tag); - if (rc != 0) { + if (rc == 0) { + LASSERT(obj->oo_db); + rc = osd_object_init0(env, obj); + } else { CERROR("%s: lookup "DFID"/"LPX64" failed: rc = %d\n", osd->od_svname, PFID(lu_object_fid(l)), oid, rc); - GOTO(out, rc); } - LASSERT(obj->oo_db); - rc = osd_object_init0(env, obj); - if (rc != 0) - GOTO(out, rc); - - rc = osd_check_lma(env, obj); - if (rc != 0) - GOTO(out, rc); } else if (rc == -ENOENT) { rc = 0; } LASSERT(osd_invariant(obj)); -out: RETURN(rc); } diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index dbb7dcf..f5d07f6 100644 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -677,30 +677,6 @@ test_17n() { } run_test 17n "run e2fsck against master/slave MDT which contains remote dir" -test_17o() { - local WDIR=$DIR/${tdir}o - local mdt_index - local mdtdevname - local rc=0 - - mkdir -p $WDIR - mdt_index=$($LFS getstripe -M $WDIR) - mdt_index=$((mdt_index+1)) - mdtdevname=$(mdsdevname $mdt_index) - - touch $WDIR/$tfile - stop mds${mdt_index} - start mds${mdt_index} $mdtdevname $MDS_MOUNT_OPTS - - #define OBD_FAIL_OSD_LMA_INCOMPAT 0x194 - do_facet mds${mdt_index} lctl set_param fail_loc=0x194 - ls -l $WDIR/$tfile && rc=1 - do_facet mds${mdt_index} lctl set_param fail_loc=0 - [[ $rc -ne 0 ]] && error "stat file should fail" - true -} -run_test 17o "stat file with incompat LMA feature" - test_18() { touch $DIR/f || error "Failed to touch $DIR/f: $?" ls $DIR || error "Failed to ls $DIR: $?"