X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lustre%2Flfsck%2Flfsck_layout.c;h=68ca0226442d6830d9845cc1ec5ec73af599ed03;hp=b2aad0407ce14e285fca73e7edc07f7d8d9f4c06;hb=be009cb4a73b3bef7302083bec7d1d6289d515b7;hpb=095281bd8070cddae1fead7117a48ac1f09d165b diff --git a/lustre/lfsck/lfsck_layout.c b/lustre/lfsck/lfsck_layout.c index b2aad04..68ca022 100644 --- a/lustre/lfsck/lfsck_layout.c +++ b/lustre/lfsck/lfsck_layout.c @@ -2329,6 +2329,9 @@ static int lfsck_layout_recreate_parent(const struct lu_env *env, int rc = 0; ENTRY; + if (lfsck_is_dryrun(lfsck)) + GOTO(log, rc = 0); + if (unlikely(lpf == NULL)) GOTO(log, rc = -ENXIO); @@ -2729,6 +2732,9 @@ static int lfsck_layout_conflict_create(const struct lu_env *env, if (rc != 0 && rc != -ENOENT) GOTO(unlock, rc); + if (lfsck_is_dryrun(com->lc_lfsck)) + GOTO(unlock, rc = 0); + th = dt_trans_create(env, dev); if (IS_ERR(th)) GOTO(unlock, rc = PTR_ERR(th)); @@ -2808,6 +2814,9 @@ static int lfsck_layout_recreate_lovea(const struct lu_env *env, bool new_mirror = true; ENTRY; + if (lfsck_is_dryrun(lfsck)) + RETURN(0); + rc = lfsck_ibits_lock(env, lfsck, parent, &lh, MDS_INODELOCK_LAYOUT | MDS_INODELOCK_XATTR, LCK_EX); @@ -5662,14 +5671,15 @@ again: lmm = buf->lb_buf; magic = le32_to_cpu(lmm->lmm_magic); if (magic == LOV_MAGIC_COMP_V1) { + struct lov_mds_md_v1 *v1; int i; lcm = buf->lb_buf; count = le16_to_cpu(lcm->lcm_entry_count); for (i = 0; i < count; i++) { lcme = &lcm->lcm_entries[i]; - lmm = buf->lb_buf + le32_to_cpu(lcme->lcme_offset); - if (memcmp(oi, &lmm->lmm_oi, sizeof(*oi)) != 0) + v1 = buf->lb_buf + le32_to_cpu(lcme->lcme_offset); + if (memcmp(oi, &v1->lmm_oi, sizeof(*oi)) != 0) goto fix; } @@ -5718,12 +5728,13 @@ fix: } if (magic == LOV_MAGIC_COMP_V1) { + struct lov_mds_md_v1 *v1; int i; for (i = 0; i < count; i++) { lcme = &lcm->lcm_entries[i]; - lmm = buf->lb_buf + le32_to_cpu(lcme->lcme_offset); - lmm->lmm_oi = *oi; + v1 = buf->lb_buf + le32_to_cpu(lcme->lcme_offset); + v1->lmm_oi = *oi; } } else { lmm->lmm_oi = *oi;