#define OBD_FAIL_OST_INTEGRITY_FAULT 0x243
#define OBD_FAIL_OST_INTEGRITY_CMP 0x244
#define OBD_FAIL_OST_DISCONNECT_DELAY 0x245
+#define OBD_FAIL_OST_DELAY_TRANS 0x246
#define OBD_FAIL_LDLM 0x300
#define OBD_FAIL_LDLM_NAMESPACE_NEW 0x301
EXIT;
ofd_counter_incr(exp, LPROC_OFD_STATS_CREATE,
tsi->tsi_jobid, 1);
+ if (unlikely(!oseq->os_last_id_synced))
+ oseq->os_last_id_synced = 1;
out:
mutex_unlock(&oseq->os_create_lock);
out_nolock:
mutex_init(&oseq->os_create_lock);
spin_lock_init(&oseq->os_last_oid_lock);
ostid_set_seq(&oseq->os_oi, seq);
+ oseq->os_last_id_synced = 0;
atomic_set(&oseq->os_refc, 1);
struct mutex os_create_lock;
atomic_t os_refc;
struct dt_object *os_lastid_obj;
- unsigned long os_destroys_in_progress:1;
+ unsigned long os_destroys_in_progress:1,
+ os_last_id_synced:1;
};
struct ofd_device {
GOTO(out_lvb, rc = PTR_ERR(fo));
rc = ofd_attr_get(env, fo, &info->fti_attr);
- if (rc)
+ if (rc) {
+ struct ofd_seq *oseq;
+ __u64 seq;
+
+ /* Object could be recreated during the first
+ * CLEANUP_ORPHAN request. */
+ if (rc == -ENOENT) {
+ seq = fid_seq(&info->fti_fid);
+ oseq = ofd_seq_load(env, ofd, fid_seq_is_idif(seq) ?
+ FID_SEQ_OST_MDT0 : seq);
+ if (!IS_ERR_OR_NULL(oseq)) {
+ if (!oseq->os_last_id_synced)
+ rc = -EAGAIN;
+ ofd_seq_put(env, oseq);
+ }
+ }
GOTO(out_obj, rc);
+ }
lvb->lvb_size = info->fti_attr.la_size;
lvb->lvb_blocks = info->fti_attr.la_blocks;
if (error)
CERROR("transaction @0x%p commit error: %d\n", th, error);
+ OBD_FAIL_TIMEOUT(OBD_FAIL_OST_DELAY_TRANS, 40);
/* call per-transaction callbacks if any */
list_for_each_entry_safe(dcb, tmp, &oh->ot_commit_dcb_list,
dcb_linkage) {
}
run_test 10 "conflicting PW & PR locks on a client"
+test_12() {
+ [ $FAILURE_MODE != "HARD" ] &&
+ skip "Test needs FAILURE_MODE HARD" && return 0
+ remote_ost || { skip "need remote OST" && return 0; }
+
+ local tmp=$TMP/$tdir
+ local dir=$DIR/$tdir
+ declare -a pids
+
+
+ mkdir -p $tmp || error "can't create $tmp"
+ mkdir -p $dir || error "can't create $dir"
+
+ $LFS setstripe -c 1 -i 0 $dir
+
+ for i in `seq 1 10`; do mkdir $dir/d$i; done
+
+ #define OBD_FAIL_OST_DELAY_TRANS 0x245
+ do_facet ost1 "$LCTL set_param fail_loc=0x245" ||
+ error "can't set fail_loc"
+
+ for i in `seq 1 10`;
+ do
+ createmany -o $dir/d$i/$(openssl rand -base64 12) 500 &
+ pids+=($!)
+ done
+ echo "Waiting createmany pids"
+ wait ${pids[@]}
+
+ ls -lR $dir > $tmp/ls_r_out 2>&1&
+ local ls_pid=$!
+
+ facet_failover ost1
+
+ echo "starting wait for ls -l"
+ wait $ls_pid
+ grep "?\|No such file or directory" $tmp/ls_r_out &&
+ error "Found file without object on OST"
+ rm -rf $tmp
+ rm -rf $dir
+}
+run_test 12 "check stat after OST failover"
+
complete $SECONDS
check_and_cleanup_lustre
exit_status