#define OBD_FAIL_OST_DQACQ_NET 0x230
#define OBD_FAIL_OST_STATFS_EINPROGRESS 0x231
#define OBD_FAIL_OST_SET_INFO_NET 0x232
+#define OBD_FAIL_OST_NODESTROY 0x233
#define OBD_FAIL_LDLM 0x300
#define OBD_FAIL_LDLM_NAMESPACE_NEW 0x301
LASSERT(exp != NULL);
skip_orphan = !!(exp_connect_flags(exp) & OBD_CONNECT_SKIP_ORPHAN);
+ if (OBD_FAIL_CHECK(OBD_FAIL_OST_NODESTROY))
+ goto done;
+
LCONSOLE(D_INFO, "%s: deleting orphan objects from "DOSTID
" to "DOSTID"\n", ofd_name(ofd), seq, end_id + 1, seq, last);
GOTO(out_put, rc);
rc = ofd_destroy_by_fid(env, ofd, fid, 1);
- if (rc != 0 && rc != -ENOENT) /* this is pretty fatal... */
- CEMERG("%s: error destroying precreated id "DFID
- ": rc = %d\n", ofd_name(ofd), PFID(fid), rc);
+ if (rc != 0 && rc != -ENOENT && rc != -ESTALE &&
+ likely(rc != -EREMCHG && rc != -EINPROGRESS))
+ /* this is pretty fatal... */
+ CEMERG("%s: error destroying precreated id "
+ DFID": rc = %d\n",
+ ofd_name(ofd), PFID(fid), rc);
oid--;
if (!skip_orphan) {
CDEBUG(D_HA, "%s: after destroy: set last_id to "DOSTID"\n",
ofd_name(ofd), seq, oid);
+done:
if (!skip_orphan) {
+ ofd_seq_last_oid_set(oseq, oid);
rc = ofd_seq_last_oid_write(env, ofd, oseq);
} else {
/* don't reuse orphan object, return last used objid */
int rc;
ENTRY;
- if (OBD_FAIL_CHECK(OBD_FAIL_OSD_COMPAT_INVALID_ENTRY))
- RETURN(0);
-
CLASSERT(LMA_OLD_SIZE >= sizeof(*lma));
rc = __osd_xattr_get(inode, dentry, XATTR_NAME_LMA,
info->oti_mdt_attrs_old, LMA_OLD_SIZE);
echo "stopall"
stopall > /dev/null
+
+ #define OBD_FAIL_OST_NODESTROY 0x233
+ do_facet ost1 $LCTL set_param fail_loc=0x233
+
echo "setupall"
setupall > /dev/null
- do_facet ost1 $LCTL set_param fail_loc=0
local STATUS=$($SHOW_SCRUB_ON_OST | awk '/^status/ { print $2 }')
[ "$STATUS" == "init" ] ||
error "(1) Expect 'init', but got '$STATUS'"
[ "$STATUS" == "completed" ] ||
error "(3) Expect 'completed', but got '$STATUS'"
+ do_facet ost1 $LCTL set_param fail_loc=0
ls -ail $DIR/$tdir > /dev/null 2>&1 || error "(4) ls should succeed"
}
run_test 12 "OI scrub can rebuild invalid /O entries"