From: Li Dongyang Date: Fri, 10 Dec 2021 11:44:09 +0000 (+1100) Subject: LU-14692 osp: deprecate IDIF sequence for MDT0000 X-Git-Tag: 2.15.55~79 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=6d2e7d191a7b27cde62b605dbed14488cfd4d410;p=fs%2Flustre-release.git LU-14692 osp: deprecate IDIF sequence for MDT0000 Always return true for IDIF seq osp_fid_end_seq so osp precreate will rollover to a new seq in the FID_SEQ_NORMAL range for MDT0000. Remove conf-sanity test_122b: Check OST sequence wouldn't change when IDIF 32bit overflows Change-Id: I85a0e38266331c96d971d68ec353949ccac3fc21 Signed-off-by: Li Dongyang Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/45822 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Oleg Drokin Reviewed-by: Andreas Dilger Reviewed-by: Sergey Cheremencev --- diff --git a/lustre/osp/osp_internal.h b/lustre/osp/osp_internal.h index 4cbdc9b..cd99fae 100644 --- a/lustre/osp/osp_internal.h +++ b/lustre/osp/osp_internal.h @@ -571,15 +571,10 @@ static inline void osp_update_last_fid(struct osp_device *d, struct lu_fid *fid) static int osp_fid_end_seq(const struct lu_env *env, struct lu_fid *fid) { - if (fid_is_idif(fid)) { - struct osp_thread_info *info = osp_env_info(env); - struct ost_id *oi = &info->osi_oi; - - fid_to_ostid(fid, oi); - return ostid_id(oi) == IDIF_MAX_OID; - } else { - return fid_oid(fid) == LUSTRE_DATA_SEQ_MAX_WIDTH; - } + /* Skip IDIF sequence for MDT0000 */ + if (fid_is_idif(fid)) + return 1; + return fid_oid(fid) == LUSTRE_DATA_SEQ_MAX_WIDTH; } static inline int osp_precreate_end_seq_nolock(const struct lu_env *env, diff --git a/lustre/osp/osp_precreate.c b/lustre/osp/osp_precreate.c index 8502574..0b32464 100644 --- a/lustre/osp/osp_precreate.c +++ b/lustre/osp/osp_precreate.c @@ -1364,10 +1364,6 @@ static int osp_precreate_thread(void *_args) if (unlikely(osp_precreate_end_seq(env, d) && osp_create_end_seq(env, d))) { - LCONSOLE_INFO("%s:%#llx is used up." - " Update to new seq\n", - d->opd_obd->obd_name, - fid_seq(&d->opd_pre_last_created_fid)); rc = osp_precreate_rollover_new_seq(env, d); if (rc) continue; diff --git a/lustre/tests/conf-sanity.sh b/lustre/tests/conf-sanity.sh index b6dd545..713d524 100644 --- a/lustre/tests/conf-sanity.sh +++ b/lustre/tests/conf-sanity.sh @@ -9497,69 +9497,6 @@ test_122a() { } run_test 122a "Check OST sequence update" -test_122b() { - (( OST1_VERSION >= $(version_code 2.14.52) )) || - skip "Need OST version at least 2.14.52" - local err - - reformat - LOAD_MODULES_REMOTE=true load_modules -#define OBD_FAIL_OFD_SET_OID 0x1e0 - do_facet ost1 $LCTL set_param fail_loc=0x00001e0 - - stack_trap cleanup EXIT - setup_noconfig - do_facet ost1 $LCTL set_param obdfilter.*.precreate_batch=256 - $LFS mkdir -i0 -c1 $DIR/$tdir || error "failed to create directory" - $LFS setstripe -i0 -c1 $DIR/$tdir || error "failed to setstripe" - do_facet ost1 $LCTL set_param fail_loc=0 - # overflow IDIF 32bit and create > OST_MAX_PRECREATE*5 - # so a new wrong sequence would differ from an original with error - #define OST_MAX_PRECREATE 20000 - local ost_max_precreate=20100 - local num_create=$(( ost_max_precreate * 5 )) - - # Check the number of inodes available on OST0 - local files=0 - local ifree=$($LFS df -i $MOUNT | - awk '/OST0000/ { print $4 }'; exit ${PIPESTATUS[0]}) - - log "On OST0, $ifree inodes available. Want $num_create. rc=$?" - - if [ $ifree -lt 10000 ]; then - files=$(( ifree - 50 )) - else - files=10000 - fi - - local j=$((num_create / files + 1)) - - for i in $(seq 1 $j); do - createmany -o $DIR/$tdir/$tfile-$i- $files || - error "createmany fail create $files files: $?" - unlinkmany $DIR/$tdir/$tfile-$i- $files || - error "unlinkmany failed unlink $files files" - done - sync - touch $DIR/$tdir/$tfile - do_facet ost1 sync - #we need a write req during recovery for ofd_seq_load - replay_barrier ost1 - dd if=/dev/urandom of=$DIR/$tdir/$tfile bs=1024k count=1 oflag=sync || - error "failed to write file" - - # OBD_FAIL_OST_CREATE_NET 0x204 - do_facet ost1 $LCTL set_param fail_loc=0x80000204 - fail ost1 - createmany -o $DIR/$tdir/file_ 100 - sync - - err=$(do_facet ost1 dmesg | tac | sed "/Recovery over/,$ d" | - grep "OST replaced or reformatted") - [ -z "$err" ] || error $err -} -run_test 122b "Check OST sequence wouldn't change when IDIF 32bit overflows" - test_123aa() { remote_mgs_nodsh && skip "remote MGS with nodsh" [ -d $MOUNT/.lustre ] || setup