diff options
author | Raghavendra G <raghavendra@gluster.com> | 2011-09-13 12:15:49 +0530 |
---|---|---|
committer | Vijay Bellur <vijay@gluster.com> | 2011-09-19 23:09:32 -0700 |
commit | 2e90cfb9f481f359726321148c9bff582b07dbc4 (patch) | |
tree | ab9fe7f1e85274cca730dbe922e7d63791311410 | |
parent | cd348fa425b5f03cbed45384d26208a240cdde1f (diff) |
features/quota: explicitly create xattrs in marker_create_cbk
- the earlier approach of creating quota related xattrs through
side-effect of updating size and contribution values won't work,
since when no contribution xattr is present, the updation process
treats contribution value as zero and hence will be equal to size
of freshly created files
Change-Id: If9b2063b1ac3a4cf50d3fe2c81e907bc8eccb677
BUG: 3531
Reviewed-on: http://review.gluster.com/383
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Mohammed Junaid <junaid@gluster.com>
-rw-r--r-- | xlators/features/marker/src/marker-quota.c | 7 | ||||
-rw-r--r-- | xlators/features/marker/src/marker.c | 6 |
2 files changed, 10 insertions, 3 deletions
diff --git a/xlators/features/marker/src/marker-quota.c b/xlators/features/marker/src/marker-quota.c index 4e820cc2006..f108b014247 100644 --- a/xlators/features/marker/src/marker-quota.c +++ b/xlators/features/marker/src/marker-quota.c @@ -904,9 +904,16 @@ int32_t mq_inode_creation_done (call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, int32_t op_errno) { + quota_local_t *local = NULL; + if (frame == NULL) return 0; + local = frame->local; + + /* xattr creation might've changed the disk-usage */ + mq_initiate_quota_txn (this, &local->loc); + QUOTA_STACK_DESTROY (frame, this); return 0; diff --git a/xlators/features/marker/src/marker.c b/xlators/features/marker/src/marker.c index 89da0893295..36ce3d79e23 100644 --- a/xlators/features/marker/src/marker.c +++ b/xlators/features/marker/src/marker.c @@ -539,7 +539,7 @@ marker_create_cbk (call_frame_t *frame, void *cookie, xlator_t *this, priv = this->private; if (priv->feature_enabled & GF_QUOTA) - mq_inspect_file_xattr (this, &local->loc, NULL, *buf); + mq_set_inode_xattr (this, &local->loc); if (priv->feature_enabled & GF_XTIME) marker_xtime_update_marks (this, local); @@ -1610,7 +1610,7 @@ marker_symlink_cbk (call_frame_t *frame, void *cookie, xlator_t *this, priv = this->private; if (priv->feature_enabled & GF_QUOTA) - mq_inspect_file_xattr (this, &local->loc, NULL, *buf); + mq_set_inode_xattr (this, &local->loc); if (priv->feature_enabled & GF_XTIME) marker_xtime_update_marks (this, local); @@ -1679,7 +1679,7 @@ marker_mknod_cbk (call_frame_t *frame, void *cookie, xlator_t *this, priv = this->private; if ((priv->feature_enabled & GF_QUOTA) && (S_ISREG (local->mode))) { - mq_inspect_file_xattr (this, &local->loc, NULL, *buf); + mq_set_inode_xattr (this, &local->loc); } if (priv->feature_enabled & GF_XTIME) |