From 7cbf23bbc61879e7af70bbb2b42951a73966f3c6 Mon Sep 17 00:00:00 2001 From: N Balachandran Date: Wed, 27 Mar 2019 10:07:11 +0530 Subject: cluster/dht: sync brick root perms on add brick If a single brick is added to the volume and the newly added brick is the first to respond to a dht_revalidate call, its stbuf will not be merged into local->stbuf as the brick does not yet have a layout. The is_permission_different check therefore fails to detect that an attr heal is required as it only considers the stbuf values from existing bricks. To fix this, merge all stbuf values into local->stbuf and use local->prebuf to store the correct directory attributes. Change-Id: Ic9e8b04a1ab9ed1248b6b056e3450bbafe32e1bc fixes: bz#1693057 Signed-off-by: N Balachandran --- tests/bugs/distribute/bug-1368012.t | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'tests') diff --git a/tests/bugs/distribute/bug-1368012.t b/tests/bugs/distribute/bug-1368012.t index f89314b1f2..0b626353aa 100644 --- a/tests/bugs/distribute/bug-1368012.t +++ b/tests/bugs/distribute/bug-1368012.t @@ -15,13 +15,14 @@ TEST pidof glusterd; TEST $CLI volume info; ## Lets create volume -TEST $CLI volume create $V0 $H0:/${V0}{1,2}; +TEST $CLI volume create $V0 $H0:$B0/${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; +EXPECT_WITHIN $PROCESS_UP_TIMEOUT "2" online_brick_count TEST $CLI volume set $V0 performance.stat-prefetch off EXPECT 'Started' volinfo_field $V0 'Status'; TEST glusterfs -s $H0 --volfile-id=$V0 $M0 @@ -35,16 +36,16 @@ TEST chmod 444 $M0 TEST permission_root=`stat -c "%A" $M0` TEST echo $permission_root #Add-brick -TEST $CLI volume add-brick $V0 $H0:/${V0}3 +TEST $CLI volume add-brick $V0 $H0:$B0/${V0}3 +EXPECT_WITHIN $PROCESS_UP_TIMEOUT "3" online_brick_count #Allow one lookup to happen -TEST pushd $M0 -TEST ls +TEST ls $M0 #Generate another lookup echo 3 > /proc/sys/vm/drop_caches -TEST ls +TEST ls $M0 #check root permission EXPECT_WITHIN "5" $permission_root get_permission $M0 #check permission on the new-brick -EXPECT $permission_root get_permission /${V0}3 +EXPECT $permission_root get_permission $B0/${V0}3 cleanup -- cgit