Whamcloud - gitweb
LU-8726 osd-ldiskfs: bypass read for benchmarking
[fs/lustre-release.git] / lustre / ofd / ofd_io.c
index 7a045cb..bd2da51 100644 (file)
@@ -23,7 +23,7 @@
  * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
  * Use is subject to license terms.
  *
- * Copyright (c) 2012, 2015, Intel Corporation.
+ * Copyright (c) 2012, 2016, Intel Corporation.
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
@@ -1013,6 +1013,7 @@ ofd_commitrw_write(const struct lu_env *env, struct obd_export *exp,
        struct dt_object *o;
        struct thandle *th;
        int rc = 0;
+       int rc2 = 0;
        int retries = 0;
        int i;
        bool soft_sync = false;
@@ -1046,7 +1047,7 @@ ofd_commitrw_write(const struct lu_env *env, struct obd_export *exp,
        la->la_valid &= LA_ATIME | LA_MTIME | LA_CTIME;
 
        /* do fake write, to simulate the write case for performance testing */
-       if (OBD_FAIL_CHECK(OBD_FAIL_OST_FAKE_WRITE)) {
+       if (OBD_FAIL_CHECK(OBD_FAIL_OST_FAKE_RW)) {
                struct niobuf_local *last = &lnb[niocount - 1];
                __u64 file_size = last->lnb_file_offset + last->lnb_len;
                __u64 valid = la->la_valid;
@@ -1136,7 +1137,9 @@ out_stop:
                        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);