- struct lmv_stripe_md *old_lsm = lli->lli_lsm_md;
- int idx;
- bool layout_changed = lsm->lsm_md_layout_version >
- old_lsm->lsm_md_layout_version;
-
- int mask = layout_changed ? D_INODE : D_ERROR;
-
- CDEBUG(mask,
- "%s: inode@%p "DFID" lmv layout %s magic %#x/%#x "
- "stripe count %d/%d master_mdt %d/%d "
- "hash_type %#x/%#x version %d/%d migrate offset %d/%d "
- "migrate hash %#x/%#x pool %s/%s\n",
- ll_get_fsname(inode->i_sb, NULL, 0), inode,
- PFID(&lli->lli_fid),
- layout_changed ? "changed" : "mismatch",
- lsm->lsm_md_magic, old_lsm->lsm_md_magic,
- lsm->lsm_md_stripe_count,
- old_lsm->lsm_md_stripe_count,
- lsm->lsm_md_master_mdt_index,
- old_lsm->lsm_md_master_mdt_index,
- lsm->lsm_md_hash_type, old_lsm->lsm_md_hash_type,
- lsm->lsm_md_layout_version,
- old_lsm->lsm_md_layout_version,
- lsm->lsm_md_migrate_offset,
- old_lsm->lsm_md_migrate_offset,
- lsm->lsm_md_migrate_hash,
- old_lsm->lsm_md_migrate_hash,
- lsm->lsm_md_pool_name,
- old_lsm->lsm_md_pool_name);
-
- for (idx = 0; idx < old_lsm->lsm_md_stripe_count; idx++)
- CDEBUG(mask, "old stripe[%d] "DFID"\n",
- idx, PFID(&old_lsm->lsm_md_oinfo[idx].lmo_fid));
-
- for (idx = 0; idx < lsm->lsm_md_stripe_count; idx++)
- CDEBUG(mask, "new stripe[%d] "DFID"\n",
- idx, PFID(&lsm->lsm_md_oinfo[idx].lmo_fid));
-
- if (!layout_changed)
- RETURN(-EINVAL);
+ if (lmv_dir_striped(lli->lli_lsm_md) &&
+ lsm->lsm_md_layout_version <=
+ lli->lli_lsm_md->lsm_md_layout_version) {
+ CERROR("%s: "DFID" dir layout mismatch:\n",
+ ll_i2sbi(inode)->ll_fsname,
+ PFID(&lli->lli_fid));
+ lsm_md_dump(D_ERROR, lli->lli_lsm_md);
+ lsm_md_dump(D_ERROR, lsm);
+ GOTO(unlock, rc = -EINVAL);
+ }