summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--xlators/features/quota/src/quota.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/xlators/features/quota/src/quota.c b/xlators/features/quota/src/quota.c
index 665999860..f563873d0 100644
--- a/xlators/features/quota/src/quota.c
+++ b/xlators/features/quota/src/quota.c
@@ -3505,13 +3505,13 @@ quota_statfs_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
if (ctx->hard_lim <= 0) {
inode_ctx_get (inode->table->root, this, &value);
ctx = (quota_inode_ctx_t *)(unsigned long) value;
- if (!ctx)
+ if (!ctx || ctx->hard_lim < 0)
goto unwind;
}
- usage = (ctx->size) / buf->f_bsize;
+ { /* statfs is adjusted in this code block */
+ usage = (ctx->size) / buf->f_bsize;
- if (ctx->hard_lim > 0) {
blocks = ctx->hard_lim / buf->f_bsize;
buf->f_blocks = blocks;