diff -urb glusterfs-3.5.1beta2/xlators/cluster/dht/src/dht-common.c glusterfs-3.5.1.orig/xlators/cluster/dht/src/dht-common.c --- glusterfs-3.5.1beta2/xlators/cluster/dht/src/dht-common.c 2014-06-10 18:55:22.000000000 +0200 +++ glusterfs-3.5.1.orig/xlators/cluster/dht/src/dht-common.c 2014-06-17 22:46:28.710636632 +0200 @@ -523,6 +523,28 @@ } int +permission_changed (ia_prot_t *local, ia_prot_t *stbuf) +{ + if( (local->owner.read != stbuf->owner.read) || + (local->owner.write != stbuf->owner.write) || + (local->owner.exec != stbuf->owner.exec) || + (local->group.read != stbuf->group.read) || + (local->group.write != stbuf->group.write) || + (local->group.exec != stbuf->group.exec) || + (local->other.read != stbuf->other.read) || + (local->other.write != stbuf->other.write) || + (local->other.exec != stbuf->other.exec ) || + (local->suid != stbuf->suid ) || + (local->sgid != stbuf->sgid ) || + (local->sticky != stbuf->sticky )) + { + return 1; + } else { + return 0; + } +} + +int dht_revalidate_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int op_ret, int op_errno, inode_t *inode, struct iatt *stbuf, dict_t *xattr, @@ -617,12 +639,16 @@ stbuf->ia_ctime_nsec)) { local->prebuf.ia_gid = stbuf->ia_gid; local->prebuf.ia_uid = stbuf->ia_uid; + local->prebuf.ia_prot = stbuf->ia_prot; } } if (local->stbuf.ia_type != IA_INVAL) { if ((local->stbuf.ia_gid != stbuf->ia_gid) || - (local->stbuf.ia_uid != stbuf->ia_uid)) { + (local->stbuf.ia_uid != stbuf->ia_uid) || + (permission_changed (&(local->stbuf.ia_prot) + , (&(stbuf->ia_prot))))) + { local->need_selfheal = 1; } } @@ -669,6 +695,8 @@ uuid_copy (local->gfid, local->stbuf.ia_gfid); local->stbuf.ia_gid = local->prebuf.ia_gid; local->stbuf.ia_uid = local->prebuf.ia_uid; + local->stbuf.ia_prot = local->prebuf.ia_prot; + copy = create_frame (this, this->ctx->pool); if (copy) { copy_local = dht_local_init (copy, &local->loc, diff -urb glusterfs-3.5.1beta2/xlators/cluster/dht/src/dht-selfheal.c glusterfs-3.5.1.orig/xlators/cluster/dht/src/dht-selfheal.c --- glusterfs-3.5.1beta2/xlators/cluster/dht/src/dht-selfheal.c 2014-06-10 18:55:22.000000000 +0200 +++ glusterfs-3.5.1.orig/xlators/cluster/dht/src/dht-selfheal.c 2014-06-17 22:53:18.809616163 +0200 @@ -1010,8 +1010,8 @@ if (!subvol || (subvol == dht_first_up_subvol (this))) continue; ret = syncop_setattr (subvol, &local->loc, &local->stbuf, - (GF_SET_ATTR_UID | GF_SET_ATTR_GID), - NULL, NULL); + (GF_SET_ATTR_UID | GF_SET_ATTR_GID | + GF_SET_ATTR_MODE), NULL, NULL); if (ret) gf_log ("dht", GF_LOG_ERROR, "Failed to set uid/gid on" " %s on %s subvol (%s)", local->loc.path,