diff options
author | Vijay Bellur <vbellur@redhat.com> | 2013-08-08 12:32:11 +0530 |
---|---|---|
committer | Krishnan Parthasarathi <kparthas@redhat.com> | 2013-08-12 00:48:15 +0530 |
commit | a63d6321a7b7b15291b9f37a5253ccdf87997bf4 (patch) | |
tree | eeea4f07e7274d11dd3ddb0b29d2b9b90bdacbe7 | |
parent | 5ac16953b352a9fb17a31658e6dbe19103a63ab8 (diff) |
features/quota: Allow the gluster 'special' processes to supercede the limits
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: Iaeaa8096e00d48b2a4c3f5df61d103da0b3d6598
-rw-r--r-- | xlators/features/quota/src/quota.c | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/xlators/features/quota/src/quota.c b/xlators/features/quota/src/quota.c index c7cd7667..b0e9d0c4 100644 --- a/xlators/features/quota/src/quota.c +++ b/xlators/features/quota/src/quota.c @@ -393,6 +393,18 @@ quota_check_limit (call_frame_t *frame, inode_t *inode, xlator_t *this, delta = local->delta; GF_VALIDATE_OR_GOTO (this->name, local->stub, err); + /* 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; + return ret; + } priv = this->private; @@ -2838,8 +2850,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); ret = dict_get_bin (dict, QUOTA_UPDATE_USAGE_KEY, (void **) &size); if (0 == ret) { @@ -2901,8 +2914,9 @@ 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); + if (0 <= frame->root->pid) + GF_IF_INTERNAL_XATTR_GOTO ("trusted.glusterfs.quota*", dict, + op_errno, err); wind: STACK_WIND (frame, priv->is_quota_on? |