lnb[j+k].lnb_flags = rnb[i].rnb_flags;
if (!(rnb[i].rnb_flags & OBD_BRW_GRANTED))
lnb[j+k].lnb_rc = -ENOSPC;
-
- /* remote client can't break through quota */
- if (exp_connect_rmtclient(exp))
- lnb[j+k].lnb_flags &= ~OBD_BRW_NOQUOTA;
}
j += rc;
*nr_local += rc;
LASSERT(oa != NULL);
- if (OBD_FAIL_CHECK(OBD_FAIL_OST_ENOENT)) {
+ if (OBD_FAIL_CHECK(OBD_FAIL_SRV_ENOENT)) {
struct ofd_seq *oseq;
oseq = ofd_seq_load(env, ofd, ostid_seq(&oa->o_oi));
int niocount, struct niobuf_local *lnb,
unsigned long granted, int old_rc)
{
- struct ofd_object *fo;
- struct dt_object *o;
- struct thandle *th;
- int rc = 0;
- int retries = 0;
- int i;
struct filter_export_data *fed = &exp->exp_filter_data;
- bool soft_sync = false;
- bool cb_registered = false;
+ struct ofd_object *fo;
+ struct dt_object *o;
+ struct thandle *th;
+ int rc = 0;
+ int retries = 0;
+ int i;
+ bool soft_sync = false;
+ bool cb_registered = false;
+ bool fake_write = false;
ENTRY;
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)) {
+ struct niobuf_local *last = &lnb[niocount - 1];
+ __u64 file_size = last->lnb_file_offset + last->lnb_len;
+ __u64 valid = la->la_valid;
+
+ la->la_valid = LA_SIZE;
+ la->la_size = 0;
+ rc = dt_attr_get(env, o, la);
+ if (rc < 0 && rc != -ENOENT)
+ GOTO(out, rc);
+
+ if (file_size < la->la_size)
+ file_size = la->la_size;
+
+ /* dirty inode by setting file size */
+ la->la_valid = valid | LA_SIZE;
+ la->la_size = file_size;
+
+ fake_write = true;
+ }
+
retry:
th = ofd_trans_create(env, ofd);
if (IS_ERR(th))
if (OBD_FAIL_CHECK(OBD_FAIL_OST_DQACQ_NET))
GOTO(out_stop, rc = -EINPROGRESS);
- rc = dt_declare_write_commit(env, o, lnb, niocount, th);
- if (rc)
- GOTO(out_stop, rc);
+ if (likely(!fake_write)) {
+ rc = dt_declare_write_commit(env, o, lnb, niocount, th);
+ if (rc)
+ GOTO(out_stop, rc);
+ }
if (la->la_valid) {
/* update [mac]time if needed */
if (rc)
GOTO(out_stop, rc);
- rc = dt_write_commit(env, o, lnb, niocount, th);
- if (rc)
- GOTO(out_stop, rc);
+ if (likely(!fake_write)) {
+ rc = dt_write_commit(env, o, lnb, niocount, th);
+ if (rc)
+ GOTO(out_stop, rc);
+ }
if (la->la_valid) {
rc = dt_attr_set(env, o, la, th);