summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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 9dcd8dc..99bfc16 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 85ee371..0f33528 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);