#define OBD_FAIL_TGT_REPLAY_TIMEOUT 0x717
#define OBD_FAIL_TGT_CLIENT_DEL 0x718
#define OBD_FAIL_TGT_SLUGGISH_NET 0x719
+#define OBD_FAIL_TGT_RCVD_EIO 0x720
#define OBD_FAIL_MDC_REVALIDATE_PAUSE 0x800
#define OBD_FAIL_MDC_ENQUEUE_PAUSE 0x801
int ofd_trans_start(const struct lu_env *env,
struct ofd_device *ofd, struct ofd_object *fo,
struct thandle *th);
-void ofd_trans_stop(const struct lu_env *env, struct ofd_device *ofd,
+int ofd_trans_stop(const struct lu_env *env, struct ofd_device *ofd,
struct thandle *th, int rc);
int ofd_txn_stop_cb(const struct lu_env *env, struct thandle *txn,
void *cookie);
struct dt_object *o;
struct thandle *th;
int rc = 0;
+ int rc2 = 0;
int retries = 0;
int i;
bool soft_sync = false;
granted = 0;
}
- ofd_trans_stop(env, ofd, th, rc);
+ rc2 = ofd_trans_stop(env, ofd, th, rc);
+ if (!rc)
+ rc = rc2;
if (rc == -ENOSPC && retries++ < 3) {
CDEBUG(D_INODE, "retry after force commit, retries:%d\n",
retries);
struct thandle *th;
struct ofd_object **batch;
struct lu_fid *fid = &info->fti_fid;
- u64 tmp;
- int rc;
- int i;
- int objects = 0;
- int nr_saved = nr;
+ u64 tmp;
+ int rc;
+ int rc2;
+ int i;
+ int objects = 0;
+ int nr_saved = nr;
ENTRY;
}
trans_stop:
- ofd_trans_stop(env, ofd, th, rc);
+ rc2 = ofd_trans_stop(env, ofd, th, rc);
+ if (rc2)
+ CERROR("%s: failed to stop transaction: rc = %d\n",
+ ofd_name(ofd), rc2);
+ if (!rc)
+ rc = rc2;
out:
for (i = 0; i < nr_saved; i++) {
fo = batch[i];
struct ofd_device *ofd = ofd_obj2dev(fo);
struct thandle *th;
struct ofd_mod_data *fmd;
- int ff_needed = 0;
- int rc;
+ int ff_needed = 0;
+ int rc;
+ int rc2;
ENTRY;
ofd_write_lock(env, fo);
GOTO(stop, rc);
stop:
- ofd_trans_stop(env, ofd, th, rc);
+ rc2 = ofd_trans_stop(env, ofd, th, rc);
+ if (rc2)
+ CERROR("%s: failed to stop transaction: rc = %d\n",
+ ofd_name(ofd), rc2);
+ if (!rc)
+ rc = rc2;
+
unlock:
ofd_write_unlock(env, fo);
struct ofd_mod_data *fmd;
struct dt_object *dob = ofd_object_child(fo);
struct thandle *th;
- int ff_needed = 0;
- int rc;
+ int ff_needed = 0;
+ int rc;
+ int rc2;
ENTRY;
GOTO(stop, rc);
stop:
- ofd_trans_stop(env, ofd, th, rc);
+ rc2 = ofd_trans_stop(env, ofd, th, rc);
+ if (rc2 != 0)
+ CERROR("%s: failed to stop transaction: rc = %d\n",
+ ofd_name(ofd), rc2);
+ if (!rc)
+ rc = rc2;
unlock:
ofd_write_unlock(env, fo);
{
struct ofd_device *ofd = ofd_obj2dev(fo);
struct thandle *th;
- int rc = 0;
+ int rc = 0;
+ int rc2;
ENTRY;
dt_ref_del(env, ofd_object_child(fo), th);
dt_destroy(env, ofd_object_child(fo), th);
stop:
- ofd_trans_stop(env, ofd, th, rc);
+ rc2 = ofd_trans_stop(env, ofd, th, rc);
+ if (rc2)
+ CERROR("%s failed to stop transaction: %d\n",
+ ofd_name(ofd), rc2);
+ if (!rc)
+ rc = rc2;
unlock:
ofd_write_unlock(env, fo);
RETURN(rc);
* \param[in] ofd OFD device
* \param[in] th transaction handle
* \param[in] rc result code of whole operation
+ *
+ * \retval 0 if successful
+ * \retval negative value if case of error
*/
-void ofd_trans_stop(const struct lu_env *env, struct ofd_device *ofd,
+int ofd_trans_stop(const struct lu_env *env, struct ofd_device *ofd,
struct thandle *th, int rc)
{
th->th_result = rc;
- dt_trans_stop(env, ofd->ofd_osd, th);
+ return dt_trans_stop(env, ofd->ofd_osd, th);
}
oh->ot_quota_trans = NULL;
if (oh->ot_handle != NULL) {
+ int rc2;
handle_t *hdl = oh->ot_handle;
/*
hdl->h_sync = th->th_sync;
oh->ot_handle = NULL;
- OSD_CHECK_SLOW_TH(oh, osd, rc = ldiskfs_journal_stop(hdl));
- if (rc != 0)
+ OSD_CHECK_SLOW_TH(oh, osd, rc2 = ldiskfs_journal_stop(hdl));
+ if (rc2 != 0)
CERROR("%s: failed to stop transaction: rc = %d\n",
- osd_name(osd), rc);
+ osd_name(osd), rc2);
+ if (!rc)
+ rc = rc2;
} else {
osd_trans_stop_cb(oh, th->th_result);
OBD_FREE_PTR(oh);
if (!lw_client) {
tti->tti_off = ted->ted_lr_off;
- rc = tgt_client_data_write(env, tgt, ted->ted_lcd, &tti->tti_off, th);
+ if (CFS_FAIL_CHECK(OBD_FAIL_TGT_RCVD_EIO))
+ rc = -EIO;
+ else
+ rc = tgt_client_data_write(env, tgt, ted->ted_lcd,
+ &tti->tti_off, th);
if (rc < 0) {
mutex_unlock(&ted->ted_lcd_lock);
RETURN(rc);
# UPDATE THE COMMENT ABOVE WITH BUG NUMBERS WHEN CHANGING ALWAYS_EXCEPT!
# with LOD/OSP landing
-# bug number for skipped tests: LU-2036 LU-8139
-ALWAYS_EXCEPT=" 76 101g $ALWAYS_EXCEPT"
+# bug number for skipped tests: LU-2036 LU-8139 LU-8411
+ALWAYS_EXCEPT=" 76 101g 407 $ALWAYS_EXCEPT"
is_sles11() # LU-4341
{
}
run_test 312 "make sure ZFS adjusts its block size by write pattern"
+test_313() {
+ local file=$DIR/$tfile
+ rm -f $file
+ $SETSTRIPE -c 1 -i 0 $file || error "setstripe failed"
+
+ # define OBD_FAIL_TGT_RCVD_EIO 0x720
+ do_facet ost1 "$LCTL set_param fail_loc=0x720"
+ dd if=/dev/zero of=$file bs=4096 oflag=direct count=1 &&
+ error "write should failed"
+ do_facet ost1 "$LCTL set_param fail_loc=0"
+ rm -f $file
+}
+run_test 313 "io should fail after last_rcvd update fail"
+
test_399() { # LU-7655 for OST fake write
# turn off debug for performance testing
local saved_debug=$($LCTL get_param -n debug)