Some fixes for typo, style, and code cleanup.
Signed-off-by: Fan Yong <yong.fan@whamcloud.com>
Change-Id: Ia027486de26cf8ee7f41da1a33a4fc39d9656752
Reviewed-on: http://review.whamcloud.com/3289
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
.llod_feat = &dt_directory_features,
};
-static struct lu_local_obj_desc llod_lfsck_bookmark_key = {
+static struct lu_local_obj_desc llod_lfsck_bookmark = {
.llod_name = lfsck_bookmark_name,
.llod_oid = LFSCK_BOOKMARK_OID,
.llod_is_index = 0,
llo_local_obj_register(&llod_capa_key);
llo_local_obj_register(&llod_mdd_orphan);
llo_local_obj_register(&llod_mdd_root);
- llo_local_obj_register(&llod_lfsck_bookmark_key);
+ llo_local_obj_register(&llod_lfsck_bookmark);
return class_register_type(&mdd_obd_device_ops, NULL, lvars.module_vars,
LUSTRE_MDD_NAME, &mdd_device_type);
llo_local_obj_unregister(&llod_capa_key);
llo_local_obj_unregister(&llod_mdd_orphan);
llo_local_obj_unregister(&llod_mdd_root);
- llo_local_obj_unregister(&llod_lfsck_bookmark_key);
+ llo_local_obj_unregister(&llod_lfsck_bookmark);
class_unregister_type(LUSTRE_MDD_NAME);
}
* To support that, we need to record the lfsck status in
* the lfsck on-disk bookmark file. But now, there is not
* lfsck component under the lfsck framework. To avoid to
- * introduce nunecessary bookmark incompatibility issues,
+ * introduce unnecessary bookmark incompatibility issues,
* we write nothing to the lfsck bookmark file now.
*
* Instead, we will reuse dt_it_ops::put() method to notify
diff -q $LUSTRE/tests/test-framework.sh $DIR/$tdir/test-framework.sh ||
error "(6) File diff failed unexpected!"
- sleep 8
+ # Sleep 5 sec to guarantee at least one object processed by OI scrub
+ sleep 5
# Fail the OI scrub to guarantee there is at least one checkpoint
#define OBD_FAIL_OSD_SCRUB_FATAL 0x192
do_facet $SINGLEMDS $LCTL set_param fail_loc=0x80000192
#define OBD_FAIL_OSD_SCRUB_CRASH 0x191
do_facet $SINGLEMDS $LCTL set_param fail_loc=0x80000191
sleep 4
- local POSITION0=$($SHOW_SCRUB | \
+ local POSITION0=$($SHOW_SCRUB |
awk '/^last_checkpoint_position/ {print $2}')
POSITION0=$((POSITION0 + 1))
[ "$STATUS" == "scanning" ] ||
error "(13) Expect 'scanning', but got '$STATUS'"
- local POSITION1=$($SHOW_SCRUB | \
+ local POSITION1=$($SHOW_SCRUB |
awk '/^latest_start_position/ {print $2}')
[ $POSITION0 -eq $POSITION1 ] ||
error "(14) Expect position: $POSITION0, but got $POSITION1"
error "Fail to start MDS!"
while true; do
- local STATUS=$($SHOW_SCRUB | \
+ local STATUS=$($SHOW_SCRUB |
awk '/^status/ { print $2 }')
[ "$STATUS" == "completed" ] && break
sleep 3 # check status every 3 seconds
* GPL HEADER END
*/
/*
- * Copyright (c) 2011 Whamcloud, Inc.
+ * Copyright (c) 2012 Whamcloud, Inc.
*/
/*
* lustre/utils/lustre_lfsck.c
"-h: Help information.\n");
}
+static int lfsck_pack_dev(struct obd_ioctl_data *data, char *arg)
+{
+ data->ioc_inllen4 = strlen(arg) + 1;
+ if (data->ioc_inllen4 > MAX_OBD_NAME) {
+ fprintf(stderr, "MDT device name is too long. "
+ "Valid length should be less than %d\n", MAX_OBD_NAME);
+ return -EINVAL;
+ }
+
+ data->ioc_inlbuf4 = arg;
+ data->ioc_dev = OBD_DEV_BY_DEVNAME;
+ return 0;
+}
+
int jt_lfsck_start(int argc, char **argv)
{
struct obd_ioctl_data data;
&index)) != EOF) {
switch (opt) {
case 'M':
- data.ioc_inllen4 = strlen(optarg) + 1;
- if (data.ioc_inllen4 > MAX_OBD_NAME) {
- fprintf(stderr, "MDT device name is too long. "
- "Valid length should be less than %d\n",
- MAX_OBD_NAME);
- return -EINVAL;
- }
-
- data.ioc_inlbuf4 = optarg;
- data.ioc_dev = OBD_DEV_BY_DEVNAME;
+ rc = lfsck_pack_dev(&data, optarg);
+ if (rc != 0)
+ return rc;
break;
case 'e':
if (strcmp(optarg, "abort") == 0) {
&index)) != EOF) {
switch (opt) {
case 'M':
- data.ioc_inllen4 = strlen(optarg) + 1;
- if (data.ioc_inllen4 > MAX_OBD_NAME) {
- fprintf(stderr, "MDT device name is too long. "
- "Valid length should be less than %d\n",
- MAX_OBD_NAME);
- return -EINVAL;
- }
-
- data.ioc_inlbuf4 = optarg;
- data.ioc_dev = OBD_DEV_BY_DEVNAME;
+ rc = lfsck_pack_dev(&data, optarg);
+ if (rc != 0)
+ return rc;
break;
case 'h':
usage_stop();