summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnand Avati <avati@dev.gluster.com>2009-08-04 18:15:22 +0000
committerAnand V. Avati <avati@dev.gluster.com>2009-08-04 17:07:22 -0700
commit925534952d05f828113ec45ff5c60294b76ef190 (patch)
tree63055d68a5720f2a13c512bfdc00b3d70b01aef6
parentb834320d168feb54cf62bb1c0ae5af6f2704385e (diff)
dht_stat_merge - use the highest uid when ambiguous
When directories on different subvolumes have different ownerships, use the highest uid/gid till self-heal resolves the inconsistency Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 191 (random Permission denied errors) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=191
-rw-r--r--xlators/cluster/dht/src/dht-helper.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/xlators/cluster/dht/src/dht-helper.c b/xlators/cluster/dht/src/dht-helper.c
index 10fc1ccda..0ef88a59b 100644
--- a/xlators/cluster/dht/src/dht-helper.c
+++ b/xlators/cluster/dht/src/dht-helper.c
@@ -311,13 +311,14 @@ dht_stat_merge (xlator_t *this, struct stat *to,
to->st_mode = from->st_mode;
to->st_nlink = from->st_nlink;
- to->st_uid = from->st_uid;
- to->st_gid = from->st_gid;
to->st_rdev = from->st_rdev;
to->st_size += from->st_size;
to->st_blksize = from->st_blksize;
to->st_blocks += from->st_blocks;
+ set_if_greater (to->st_uid, from->st_uid);
+ set_if_greater (to->st_gid, from->st_gid);
+
set_if_greater (to->st_atime, from->st_atime);
set_if_greater (to->st_mtime, from->st_mtime);
set_if_greater (to->st_ctime, from->st_ctime);