X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lustre%2Fobdfilter%2Ffilter_io_26.c;h=73bb316636162a589b01d0af2203f86d1fdcf3f4;hp=f5ca9b85ea69e76998b7d31bc035aef280b3c42e;hb=78377ff4718213ffaa609ce150afda31e3756b38;hpb=fddc386818cc1358e6c4212a7aaf6b89e5c8099a diff --git a/lustre/obdfilter/filter_io_26.c b/lustre/obdfilter/filter_io_26.c index f5ca9b8..73bb316 100644 --- a/lustre/obdfilter/filter_io_26.c +++ b/lustre/obdfilter/filter_io_26.c @@ -514,24 +514,11 @@ int filter_direct_io(int rw, struct dentry *dchild, struct filter_iobuf *iobuf, lquota_enforce(filter_quota_interface_ref, obd, iobuf->dr_ignore_quota); } -remap: + rc = fsfilt_map_inode_pages(obd, inode, iobuf->dr_pages, iobuf->dr_npages, iobuf->dr_blocks, obdfilter_created_scratchpad, create, sem); - if (rc == -EDQUOT) { - LASSERT(rw == OBD_BRW_WRITE && - !cap_raised(current->cap_effective, CAP_SYS_RESOURCE)); - - /* Unfortunately, if quota master is too busy to handle the - * pre-dqacq in time or this user has exceeded quota limit, we - * have to wait for the completion of in flight dqacq/dqrel, - * then try again */ - if (lquota_acquire(filter_quota_interface_ref, obd, - inode->i_uid, inode->i_gid)) - goto remap; - } - if (rw == OBD_BRW_WRITE) { if (rc == 0) { filter_tally_write(exp, iobuf->dr_pages, @@ -606,7 +593,7 @@ int filter_commitrw_write(struct obd_export *exp, struct obdo *oa, int i, err, cleanup_phase = 0; struct obd_device *obd = exp->exp_obd; void *wait_handle; - int total_size = 0; + int total_size = 0, rc2; unsigned int qcids[MAXQUOTAS] = {0, 0}; ENTRY; @@ -617,6 +604,22 @@ int filter_commitrw_write(struct obd_export *exp, struct obdo *oa, if (rc != 0) GOTO(cleanup, rc); + /* Unfortunately, if quota master is too busy to handle the + * pre-dqacq in time and quota hash on ost is used up, we + * have to wait for the completion of in flight dqacq/dqrel, + * then try again */ + if ((rc2 = lquota_chkquota(filter_quota_interface_ref, obd, oa->o_uid, + oa->o_gid, niocount)) == QUOTA_RET_ACQUOTA) { + OBD_FAIL_TIMEOUT(OBD_FAIL_OST_HOLD_WRITE_RPC, 90); + lquota_acquire(filter_quota_interface_ref, obd, oa->o_uid, + oa->o_gid); + } + + if (rc2 < 0) { + rc = rc2; + GOTO(cleanup, rc); + } + iobuf = filter_iobuf_get(&obd->u.filter, oti); if (IS_ERR(iobuf)) GOTO(cleanup, rc = PTR_ERR(iobuf));