summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVarun Shastry <vshastry@redhat.com>2013-08-02 15:00:14 +0530
committerVijay Bellur <vbellur@redhat.com>2013-08-07 13:06:24 +0530
commitf69faee74dd5215849f3061338397b840b141aaf (patch)
treee64b421c59d21a72d9b7f26bc22fa6594e7a5cb9
parent47d58c392998e05d7ef20b17c0089c17d7921e5e (diff)
features/quota: Allow the gluster 'special' processes to supercede the limitsquota-improvements
Don't block the gluster internal processes like rebalance, gsyncd, self heal etc from the disk quotas and the xattrs setting. Solution: Allow all the clients with negative PID. Change-Id: I2e8c540d3f95572a702a9d324ec19528a4cb76ed Signed-off-by: Varun Shastry <vshastry@redhat.com>
-rw-r--r--xlators/features/quota/src/quota.c24
1 files changed, 20 insertions, 4 deletions
diff --git a/xlators/features/quota/src/quota.c b/xlators/features/quota/src/quota.c
index c15eded..4fe4f10 100644
--- a/xlators/features/quota/src/quota.c
+++ b/xlators/features/quota/src/quota.c
@@ -319,6 +319,19 @@ quota_check_limit (call_frame_t *frame, inode_t *inode, xlator_t *this,
GF_VALIDATE_OR_GOTO (this->name, frame, out);
GF_VALIDATE_OR_GOTO (this->name, inode, out);
+ /* Allow all the trusted clients
+ * Don't block the gluster internal processes like rebalance, gsyncd,
+ * self heal etc from the disk quotas.
+ *
+ * Method: Allow all the clients with PID negative. This is by the
+ * assumption that any kernel assigned pid doesn't have the negative
+ * number.
+ */
+ if (0 > frame->root->pid) {
+ ret = 0;
+ goto out;
+ }
+
local = frame->local;
GF_VALIDATE_OR_GOTO (this->name, local, out);
@@ -2807,8 +2820,9 @@ quota_setxattr (call_frame_t *frame, xlator_t *this,
VALIDATE_OR_GOTO (this, err);
VALIDATE_OR_GOTO (loc, err);
- GF_IF_INTERNAL_XATTR_GOTO ("trusted.glusterfs.quota*", dict,
- op_errno, err);
+ if (0 <= frame->root->pid)
+ GF_IF_INTERNAL_XATTR_GOTO ("trusted.glusterfs.quota*", dict,
+ op_errno, err);
STACK_WIND (frame, quota_setxattr_cbk, FIRST_CHILD(this),
FIRST_CHILD(this)->fops->setxattr, loc, dict, flags, xdata);
@@ -2843,8 +2857,10 @@ quota_fsetxattr (call_frame_t *frame, xlator_t *this, fd_t *fd,
VALIDATE_OR_GOTO (this, err);
VALIDATE_OR_GOTO (fd, err);
- GF_IF_INTERNAL_XATTR_GOTO ("trusted.glusterfs.quota*", dict,
- op_errno, err);
+ /* Really trust all the trusted clients:- gluster internal processes */
+ if (0 <= frame->root->pid)
+ GF_IF_INTERNAL_XATTR_GOTO ("trusted.glusterfs.quota*", dict,
+ op_errno, err);
STACK_WIND (frame, quota_fsetxattr_cbk, FIRST_CHILD(this),
FIRST_CHILD(this)->fops->fsetxattr, fd, dict, flags, xdata);