Whamcloud - gitweb
LU-904 ptlrpc: redo io on -EINPROGRESS
[fs/lustre-release.git] / lustre / obdfilter / filter_io_26.c
index 5410448..cafb080 100644 (file)
@@ -483,7 +483,7 @@ int filter_direct_io(int rw, struct dentry *dchild, struct filter_iobuf *iobuf,
         struct inode *inode = dchild->d_inode;
         int blocks_per_page = CFS_PAGE_SIZE >> inode->i_blkbits;
         int rc, rc2, create;
-        cfs_semaphore_t *sem;
+        cfs_mutex_t *mutex;
         ENTRY;
 
         LASSERTF(iobuf->dr_npages <= iobuf->dr_max_pages, "%d,%d\n",
@@ -494,12 +494,12 @@ int filter_direct_io(int rw, struct dentry *dchild, struct filter_iobuf *iobuf,
                 if (iobuf->dr_npages == 0)
                         RETURN(0);
                 create = 0;
-                sem = NULL;
+                mutex = NULL;
         } else {
                 LASSERTF(rw == OBD_BRW_WRITE, "%x\n", rw);
                 LASSERT(iobuf->dr_npages > 0);
                 create = 1;
-                sem = &obd->u.filter.fo_alloc_lock;
+                mutex = &obd->u.filter.fo_alloc_lock;
 
                 lquota_enforce(filter_quota_interface_ref, obd,
                                iobuf->dr_ignore_quota);
@@ -511,7 +511,7 @@ int filter_direct_io(int rw, struct dentry *dchild, struct filter_iobuf *iobuf,
         } else {
                 rc = fsfilt_map_inode_pages(obd, inode, iobuf->dr_pages,
                                     iobuf->dr_npages, iobuf->dr_blocks,
-                                    obdfilter_created_scratchpad, create, sem);
+                                    obdfilter_created_scratchpad, create, mutex);
         }
 
         if (rw == OBD_BRW_WRITE) {
@@ -693,6 +693,9 @@ int filter_commitrw_write(struct obd_export *exp, struct obdo *oa,
         if (rc == -ENOTCONN)
                 GOTO(cleanup, rc);
 
+        if (OBD_FAIL_CHECK(OBD_FAIL_OST_DQACQ_NET))
+                GOTO(cleanup, rc = -EINPROGRESS);
+
         push_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
         cleanup_phase = 2;
 
@@ -768,8 +771,8 @@ retry:
                 goto retry;
         }
 
-        obdo_from_inode(oa, inode, NULL, rc == 0 ? FILTER_VALID_FLAGS : 0 |
-                                                   OBD_MD_FLUID |OBD_MD_FLGID);
+        obdo_from_inode(oa, inode, (rc == 0 ? FILTER_VALID_FLAGS : 0) |
+                                   OBD_MD_FLUID | OBD_MD_FLGID);
 
         lquota_getflag(filter_quota_interface_ref, obd, oa);