From e4726e843574c0db108fce1fc375241b72d7aed4 Mon Sep 17 00:00:00 2001 From: Krutika Dhananjay Date: Thu, 6 Aug 2015 12:19:23 +0530 Subject: features/shard: Fill inode ctx in readdir(p) callback too Backport of: http://review.gluster.org/#/c/11854/ The only place where shard translator was initialising inode ctx was lookup callback. But if the inodes are created and linked through readdirp, shard_lookup() path _may_ not be exercised before FUSE winds other fops on them. Since shard translator does an inode_ctx_get() first thing in most fops, an uninitialised ctx could cause it to fail the operation with ENOMEM. The solution would be to also initialise inode ctx if it has not been done already in readdir(p) callback. Change-Id: I6384e2d4c6b443c02c6620bbbc38279ddfad18ae BUG: 1251106 Signed-off-by: Krutika Dhananjay Reviewed-on: http://review.gluster.org/11866 Tested-by: NetBSD Build System Tested-by: Gluster Build System Reviewed-by: Raghavendra G --- tests/bugs/shard/bug-1250855.t | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 tests/bugs/shard/bug-1250855.t (limited to 'tests/bugs') diff --git a/tests/bugs/shard/bug-1250855.t b/tests/bugs/shard/bug-1250855.t new file mode 100644 index 00000000000..b8bc3b42513 --- /dev/null +++ b/tests/bugs/shard/bug-1250855.t @@ -0,0 +1,34 @@ +#!/bin/bash + +. $(dirname $0)/../../include.rc + +cleanup; + +TESTS_EXPECTED_IN_LOOP=40 + +TEST glusterd +TEST pidof glusterd +TEST $CLI volume create $V0 $H0:$B0/${V0}{0,1} +TEST $CLI volume start $V0 + +TEST $GFS --volfile-id=$V0 --volfile-server=$H0 $M0 +TEST mkdir $M0/dir + +for i in {1..20}; do + TEST_IN_LOOP touch $M0/dir/$i; +done + +TEST $CLI volume set $V0 features.shard on + +TEST ls $M0 +TEST ls $M0/dir + +for i in {1..10}; do + TEST_IN_LOOP mv $M0/dir/$i $M0/dir/$i-sharded; +done + +for i in {11..20}; do + TEST_IN_LOOP unlink $M0/dir/$i; +done + +cleanup; -- cgit