diff options
author | Susant Palai <spalai@redhat.com> | 2016-08-17 15:10:04 +0530 |
---|---|---|
committer | Raghavendra G <rgowdapp@redhat.com> | 2016-09-13 23:33:06 -0700 |
commit | a9ee05a6673486ef86f36a87e00d144cfb56cf9b (patch) | |
tree | 8d598c244855dd1d0e554a1457d178892c643aec /tests/bugs/distribute | |
parent | 31b045060478e1c5066f6f9c4321970fbff398de (diff) |
cluster/dht: heal root permission post add-brick
Post add-brick event the new brick will have permission of 755
by default. If the root directory permission was other than 755,
that does not get healed to the new brick leading to permission
errors/inconsistencies.
For choosing source of attr heal we can trust the subvols which
have layouts with latest ctime(as part of missing directory heal,
we heal the proper attr). In case none of the subvols have layout,
return ESTALE to retrigger a fresh lookup.
Note: This patch heals the permission of the root directories only.
Since, permission healing of directory is not straight forward and
required intrusive fix, those are not addressed here.
> Reviewed-on: http://review.gluster.org/15195
> Smoke: Gluster Build System <jenkins@build.gluster.org>
> CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
>Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
(cherry picked from commit 801cd07a4c6ec65ff930b2ae6bb5e405ccd03334)
Change-Id: If894e3895d070d46b62d2452e52c1eaafcf56c29
BUG: 1374573
Signed-off-by: Susant Palai <spalai@redhat.com>
Reviewed-on: http://review.gluster.org/15465
Smoke: Gluster Build System <jenkins@build.gluster.org>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
Diffstat (limited to 'tests/bugs/distribute')
-rw-r--r-- | tests/bugs/distribute/bug-1368012.t | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/tests/bugs/distribute/bug-1368012.t b/tests/bugs/distribute/bug-1368012.t new file mode 100644 index 00000000000..f89314b1f2e --- /dev/null +++ b/tests/bugs/distribute/bug-1368012.t @@ -0,0 +1,50 @@ +#!/bin/bash + +. $(dirname $0)/../../include.rc +. $(dirname $0)/../../volume.rc + +cleanup; + +function get_permission { + stat -c "%A" $1 +} + +## Start glusterd +TEST glusterd; +TEST pidof glusterd; +TEST $CLI volume info; + +## Lets create volume +TEST $CLI volume create $V0 $H0:/${V0}{1,2}; + +## Verify volume is created +EXPECT "$V0" volinfo_field $V0 'Volume Name'; +EXPECT 'Created' volinfo_field $V0 'Status'; +## Start volume and verify +TEST $CLI volume start $V0; +TEST $CLI volume set $V0 performance.stat-prefetch off +EXPECT 'Started' volinfo_field $V0 'Status'; +TEST glusterfs -s $H0 --volfile-id=$V0 $M0 + +##Test case: Add-brick +#------------------------------------------------------------ +#change permission of both root +TEST chmod 444 $M0 + +#store permission for comparision +TEST permission_root=`stat -c "%A" $M0` +TEST echo $permission_root +#Add-brick +TEST $CLI volume add-brick $V0 $H0:/${V0}3 + +#Allow one lookup to happen +TEST pushd $M0 +TEST ls +#Generate another lookup +echo 3 > /proc/sys/vm/drop_caches +TEST ls +#check root permission +EXPECT_WITHIN "5" $permission_root get_permission $M0 +#check permission on the new-brick +EXPECT $permission_root get_permission /${V0}3 +cleanup |