diff options
-rw-r--r-- | tests/basic/sdfs-sanity.t | 22 | ||||
-rw-r--r-- | xlators/features/sdfs/src/sdfs.c | 22 |
2 files changed, 36 insertions, 8 deletions
diff --git a/tests/basic/sdfs-sanity.t b/tests/basic/sdfs-sanity.t new file mode 100644 index 00000000000..f25376c3cad --- /dev/null +++ b/tests/basic/sdfs-sanity.t @@ -0,0 +1,22 @@ +#!/bin/bash + +. $(dirname $0)/../include.rc +. $(dirname $0)/../volume.rc + +cleanup; + +TEST glusterd +TEST pidof glusterd + +TEST $CLI volume create $V0 replica 3 $H0:$B0/${V0}{1,2,3,4,5,6,7,8,9}; +TEST $CLI volume set $V0 features.sdfs enable; +TEST $CLI volume start $V0; + +## Mount FUSE +TEST $GFS -s $H0 --volfile-id $V0 $M1; + +# This test covers lookup, mkdir, mknod, symlink, link, rename, +# create operations +TEST $(dirname $0)/rpc-coverage.sh $M1 + +cleanup; diff --git a/xlators/features/sdfs/src/sdfs.c b/xlators/features/sdfs/src/sdfs.c index 3b70dce5d27..0c45cad6238 100644 --- a/xlators/features/sdfs/src/sdfs.c +++ b/xlators/features/sdfs/src/sdfs.c @@ -263,7 +263,8 @@ sdfs_mkdir (call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode, goto err; } - ((sdfs_local_t *)new_frame->local)->stub = stub; + local = new_frame->local; + local->stub = stub; STACK_WIND (new_frame, sdfs_entrylk_cbk, FIRST_CHILD (this), @@ -355,7 +356,8 @@ sdfs_rmdir (call_frame_t *frame, xlator_t *this, loc_t *loc, int flags, goto err; } - ((sdfs_local_t *)new_frame->local)->stub = stub; + local = new_frame->local; + local->stub = stub; STACK_WIND (new_frame, sdfs_entrylk_cbk, FIRST_CHILD (this), @@ -452,7 +454,8 @@ sdfs_create (call_frame_t *frame, xlator_t *this, loc_t *loc, goto err; } - ((sdfs_local_t *)new_frame->local)->stub = stub; + local = new_frame->local; + local->stub = stub; STACK_WIND (new_frame, sdfs_entrylk_cbk, FIRST_CHILD (this), @@ -544,7 +547,8 @@ sdfs_unlink (call_frame_t *frame, xlator_t *this, loc_t *loc, goto err; } - ((sdfs_local_t *)new_frame->local)->stub = stub; + local = new_frame->local; + local->stub = stub; STACK_WIND (new_frame, sdfs_entrylk_cbk, FIRST_CHILD (this), @@ -639,7 +643,8 @@ sdfs_symlink (call_frame_t *frame, xlator_t *this, const char *linkname, goto err; } - ((sdfs_local_t *)new_frame->local)->stub = stub; + local = new_frame->local; + local->stub = stub; STACK_WIND (new_frame, sdfs_entrylk_cbk, FIRST_CHILD (this), @@ -861,7 +866,6 @@ sdfs_link (call_frame_t *frame, xlator_t *this, loc_t *oldloc, local->main_frame = frame; - lock = GF_CALLOC (1, sizeof (*lock), gf_common_mt_char); if (!lock) goto err; @@ -986,7 +990,8 @@ sdfs_mknod (call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode, goto err; } - ((sdfs_local_t *)new_frame->local)->stub = stub; + local = new_frame->local; + local->stub = stub; STACK_WIND (new_frame, sdfs_entrylk_cbk, FIRST_CHILD (this), @@ -1279,7 +1284,8 @@ sdfs_lookup (call_frame_t *frame, xlator_t *this, loc_t *loc, goto err; } - ((sdfs_local_t *)new_frame->local)->stub = stub; + local = new_frame->local; + local->stub = stub; STACK_WIND (new_frame, sdfs_entrylk_cbk, FIRST_CHILD (this), |