From a3bcd5bc095a636f2e23da8bb0e08ba17faa2738 Mon Sep 17 00:00:00 2001 From: Raghavendra G Date: Thu, 8 Aug 2013 16:34:07 +0530 Subject: features/quota: minor fixes to enforcer * send size query to quotad only if limit is set on that inode. * don't check for loc->parent while querying size from quotad, since its a nameless lookup Change-Id: I10dc2f9d1e40875382040b53cb4ee5f6d9a27133 BUG: 969461 Signed-off-by: Raghavendra G --- xlators/features/quota/src/quota-enforcer-client.c | 15 ++++----------- xlators/features/quota/src/quota.c | 2 +- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/xlators/features/quota/src/quota-enforcer-client.c b/xlators/features/quota/src/quota-enforcer-client.c index 9dcd8dc5..99bfc163 100644 --- a/xlators/features/quota/src/quota-enforcer-client.c +++ b/xlators/features/quota/src/quota-enforcer-client.c @@ -226,17 +226,10 @@ quota_enforcer_lookup (call_frame_t *frame, xlator_t *this, loc_t *loc, if (!(loc && loc->inode)) goto unwind; - if (loc->parent) { - if (!uuid_is_null (loc->parent->gfid)) - memcpy (req.pargfid, loc->parent->gfid, 16); - else - memcpy (req.pargfid, loc->pargfid, 16); - } else { - if (!uuid_is_null (loc->inode->gfid)) - memcpy (req.gfid, loc->inode->gfid, 16); - else - memcpy (req.gfid, loc->gfid, 16); - } + if (!uuid_is_null (loc->inode->gfid)) + memcpy (req.gfid, loc->inode->gfid, 16); + else + memcpy (req.gfid, loc->gfid, 16); if (xdata) { GF_PROTOCOL_DICT_SERIALIZE (this, xdata, diff --git a/xlators/features/quota/src/quota.c b/xlators/features/quota/src/quota.c index 85ee3718..0f335283 100644 --- a/xlators/features/quota/src/quota.c +++ b/xlators/features/quota/src/quota.c @@ -426,7 +426,7 @@ quota_check_limit (call_frame_t *frame, inode_t *inode, xlator_t *this, } do { - if (ctx != NULL) { + if (ctx != NULL && (ctx->hard_lim > 0 || ctx->soft_lim > 0)) { wouldbe_size = ctx->size + delta; LOCK (&ctx->lock); -- cgit