struct dt_device *dev = lfsck_obj2dev(child);
struct thandle *handle;
int rc;
+ dt_obj_version_t version;
ENTRY;
tla->la_uid = pla->la_uid;
if (unlikely(lfsck_is_dead_obj(parent)))
GOTO(unlock, rc = 1);
+ version = dt_version_get(env, child);
+ if (version == -EOPNOTSUPP)
+ version = 0;
+
/* Get the latest parent's owner. */
rc = dt_attr_get(env, parent, pla);
if (rc != 0)
GOTO(unlock, rc);
/* Some others chown/chgrp during the LFSCK, needs to do nothing. */
- if (unlikely(tla->la_uid != pla->la_uid ||
- tla->la_gid != pla->la_gid))
+ if (unlikely((!version && tla->la_ctime == 0) ||
+ tla->la_uid != pla->la_uid || tla->la_gid != pla->la_gid))
rc = 1;
else
rc = dt_attr_set(env, child, tla, handle);
dd if=/dev/zero of=$DIR/$tdir/f0 bs=1M count=1
cancel_lru_locks osc
+ # created but no setattr or write to the file.
+ mkdir $DIR/$tdir/d1
+ chown $RUNAS_ID:$RUNAS_GID $DIR/$tdir/d1
+ $RUNAS createmany -o $DIR/$tdir/d1/o 100 || error "create failed"
+
echo "Inject failure stub to skip OST-object owner changing"
#define OBD_FAIL_LFSCK_BAD_OWNER 0x1613
do_facet $SINGLEMDS $LCTL set_param fail_loc=0x1613