summaryrefslogtreecommitdiffstats
path: root/tests/basic
diff options
context:
space:
mode:
authorKrutika Dhananjay <kdhananj@redhat.com>2018-10-05 11:32:21 +0530
committerShyamsundar Ranganathan <srangana@redhat.com>2018-10-25 13:11:49 +0000
commit02a05da6989f5cd4283e2e5d62a9cfa6493d65dc (patch)
tree5f36befadd1bac300442086289ac59e5fcdc71b9 /tests/basic
parentecdc33ada79f155f2bde2860b29872526939e22b (diff)
features/shard: Hold a ref on base inode when adding a shard to lru list
Backport of: > Change-Id: Ic15ca41444dd04684a9458bd4a526b1d3e160499 > Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com> > (cherry picked from commit e627977) > BUG: 1605056 In __shard_update_shards_inode_list(), previously shard translator was not holding a ref on the base inode whenever a shard was added to the lru list. But if the base shard is forgotten and destroyed either by fuse due to memory pressure or due to the file being deleted at some point by a different client with this client still containing stale shards in its lru list, the client would crash at the time of locking lru_base_inode->lock owing to illegal memory access. So now the base shard is ref'd into the inode ctx of every shard that is added to lru list until it gets lru'd out. The patch also handles the case where none of the shards associated with a file that is about to be deleted are part of the LRU list and where an unlink at the beginning of the operation destroys the base inode (because there are no refkeepers) and hence all of the shards that are about to be deleted will be resolved without the existence of a base shard in-memory. This, if not handled properly, could lead to a crash. Change-Id: Ic15ca41444dd04684a9458bd4a526b1d3e160499 updates: bz#1641440 Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com>
Diffstat (limited to 'tests/basic')
-rw-r--r--tests/basic/inode-leak.t8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/basic/inode-leak.t b/tests/basic/inode-leak.t
index 6bfbf572f03..e112fdddf8a 100644
--- a/tests/basic/inode-leak.t
+++ b/tests/basic/inode-leak.t
@@ -11,15 +11,15 @@ TEST $CLI volume create $V0 replica 2 $H0:$B0/${V0}{0,1,2,3}
TEST $CLI volume start $V0
TEST glusterfs -s $H0 --volfile-id $V0 $M0
-EXPECT "1" get_mount_active_size_value $V0
-EXPECT "0" get_mount_lru_size_value $V0
+EXPECT "1" get_mount_active_size_value $V0 $M0
+EXPECT "0" get_mount_lru_size_value $V0 $M0
TEST cp -rf /etc $M0
TEST find $M0
TEST rm -rf $M0/*
-EXPECT "1" get_mount_active_size_value $V0
-EXPECT "0" get_mount_lru_size_value $V0
+EXPECT "1" get_mount_active_size_value $V0 $M0
+EXPECT "0" get_mount_lru_size_value $V0 $M0
cleanup