From 942d127fee13653daba49195692c5e8465f1fbff Mon Sep 17 00:00:00 2001 From: Jeff Darcy Date: Thu, 17 Mar 2016 13:33:34 -0400 Subject: dht: report constant directory size Directory size is meaningless. Every filesystem has its own unpredictable way of increasing or decreasing it, based on internal data structures and even transient conditions. Some filesystems (e.g. ext4) never decrease it at all. Others (e.g. btrfs) don't even report it. Very few programs look at it, and those that do are broken. Unfortunately, one such program is GNU tar, which will complain when it sees different values because at different times we got the value from different DHT subvolumes. To avoid such problems, just report a constant value. Change-Id: Id64ce917c75b5f7ff50cb55b6e997f3b3556e7e3 BUG: 1302948 Original-author: Shyam Signed-off-by: Jeff Darcy Signed-off-by: N Balachandran Reviewed-on: http://review.gluster.org/13770 Smoke: Gluster Build System NetBSD-regression: NetBSD Build System CentOS-regression: Gluster Build System Reviewed-by: Shyamsundar Ranganathan Reviewed-by: Vijay Bellur --- xlators/cluster/dht/src/dht-helper.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'xlators/cluster/dht/src/dht-helper.c') diff --git a/xlators/cluster/dht/src/dht-helper.c b/xlators/cluster/dht/src/dht-helper.c index 79f6ab795f2..8e82eef697c 100644 --- a/xlators/cluster/dht/src/dht-helper.c +++ b/xlators/cluster/dht/src/dht-helper.c @@ -915,6 +915,10 @@ dht_iatt_merge (xlator_t *this, struct iatt *to, to->ia_blksize = from->ia_blksize; to->ia_blocks += from->ia_blocks; + if (IA_ISDIR (from->ia_type)) { + to->ia_blocks = DHT_DIR_STAT_BLOCKS; + to->ia_size = DHT_DIR_STAT_SIZE; + } set_if_greater (to->ia_uid, from->ia_uid); set_if_greater (to->ia_gid, from->ia_gid); @@ -2257,6 +2261,8 @@ dht_heal_full_path_done (int op_ret, call_frame_t *heal_frame, void *data) main_frame = local->main_frame; local->main_frame = NULL; + dht_set_fixed_dir_stat (&local->postparent); + DHT_STACK_UNWIND (lookup, main_frame, 0, 0, local->inode, &local->stbuf, local->xattr, &local->postparent); -- cgit