summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
authorRaghavendra G <rgowdapp@redhat.com>2013-08-08 16:34:07 +0530
committerVijay Bellur <vbellur@redhat.com>2013-08-09 19:26:39 +0530
commita3bcd5bc095a636f2e23da8bb0e08ba17faa2738 (patch)
tree1f145edda2cdc8d9e1769b06ff437c01160299f1 /xlators
parent3bd5ea6baa8d1b42e4a16f1f3d36e38537a5d45a (diff)
features/quota: minor fixes to enforcerv3.4quota1
* 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 <rgowdapp@redhat.com>
Diffstat (limited to 'xlators')
-rw-r--r--xlators/features/quota/src/quota-enforcer-client.c15
-rw-r--r--xlators/features/quota/src/quota.c2
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);