From 1f074563ecdaf92b2ecf12d7ea79b2b5d8f50c2d Mon Sep 17 00:00:00 2001 From: Raghavendra G Date: Thu, 21 Apr 2011 04:10:17 +0000 Subject: features/marker-quota: Add the disk space used to parent sizes during creation of new-files or symlinks. Signed-off-by: Raghavendra G Signed-off-by: Anand Avati BUG: 2649 (Quota: size field is not getting updated properly) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2649 --- xlators/features/marker/src/marker-quota.c | 2 +- xlators/features/marker/src/marker-quota.h | 3 +++ xlators/features/marker/src/marker.c | 4 ++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/xlators/features/marker/src/marker-quota.c b/xlators/features/marker/src/marker-quota.c index acc13dfee..8a56dcbbc 100644 --- a/xlators/features/marker/src/marker-quota.c +++ b/xlators/features/marker/src/marker-quota.c @@ -912,7 +912,7 @@ quota_inodelk_cbk (call_frame_t *frame, void *cookie, if (op_ret == -1 || local->err) { gf_log (this->name, ((op_errno == ENOENT) ? GF_LOG_DEBUG : GF_LOG_INFO), - "lock setting failed"); + "lock setting failed (%s)", strerror (op_errno)); xattr_updation_done (frame, NULL, this, 0, 0, NULL); return 0; diff --git a/xlators/features/marker/src/marker-quota.h b/xlators/features/marker/src/marker-quota.h index 2eecd83e8..0011a28b6 100644 --- a/xlators/features/marker/src/marker-quota.h +++ b/xlators/features/marker/src/marker-quota.h @@ -164,6 +164,9 @@ reduce_parent_size (xlator_t *, loc_t *); int32_t quota_rename_update_newpath (xlator_t *, loc_t *); +int32_t +inspect_file_xattr (xlator_t *this, loc_t *loc, dict_t *dict, struct iatt buf); + int32_t quota_forget (xlator_t *, quota_inode_ctx_t *); #endif diff --git a/xlators/features/marker/src/marker.c b/xlators/features/marker/src/marker.c index 940dc43f4..7b339748b 100644 --- a/xlators/features/marker/src/marker.c +++ b/xlators/features/marker/src/marker.c @@ -533,7 +533,7 @@ marker_create_cbk (call_frame_t *frame, void *cookie, xlator_t *this, priv = this->private; if (priv->feature_enabled & GF_QUOTA) - quota_set_inode_xattr (this, &local->loc); + inspect_file_xattr (this, &local->loc, NULL, *buf); if (priv->feature_enabled & GF_XTIME) marker_xtime_update_marks (this, local); @@ -1199,7 +1199,7 @@ marker_symlink_cbk (call_frame_t *frame, void *cookie, xlator_t *this, priv = this->private; if (priv->feature_enabled & GF_QUOTA) - initiate_quota_txn (this, &local->loc); + inspect_file_xattr (this, &local->loc, NULL, *buf); if (priv->feature_enabled & GF_XTIME) marker_xtime_update_marks (this, local); -- cgit