From eeab758c7c7e7670f86fc1d8c3785a1ecb7208b4 Mon Sep 17 00:00:00 2001 From: Venky Shankar Date: Tue, 8 Jul 2014 13:05:15 +0530 Subject: features/gfid-access: error handling for entry creation Proceed with setattr() only on a successfull entry creation. Winding a setattr() using a freshlyOC initiated inode would most likely fail in one translator or the other (e.g. DHT expecting the layout information to be set in the inode context), which is the case if the inode was not looked up. Therefore, gfid-access handles failure entry creations and passes the _correct_ errno back to the client instead of continuing with setattr() call and probably returning back incorrect errno. Also, filling up inode->gfid is required as the new inode is not looked up and ->gfid would be certainely required for inode operations. Change-Id: Ie92f5647a89bf558c07710ab0400bce69d59fc31 BUG: 1111490 Signed-off-by: Venky Shankar Reviewed-on: http://review.gluster.org/8260 Tested-by: Gluster Build System Reviewed-by: Kotresh HR Reviewed-by: Vijay Bellur --- tests/bugs/bug-1111490.t | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 tests/bugs/bug-1111490.t (limited to 'tests') diff --git a/tests/bugs/bug-1111490.t b/tests/bugs/bug-1111490.t new file mode 100644 index 00000000000..39aa0f9a69e --- /dev/null +++ b/tests/bugs/bug-1111490.t @@ -0,0 +1,32 @@ +#!/bin/bash + +. $(dirname $0)/../include.rc +. $(dirname $0)/../volume.rc + +cleanup; + +TEST glusterd +TEST pidof glusterd + +TEST $CLI volume create $V0 $H0:$B0/${V0}0 +TEST $CLI volume start $V0 + +# mount with auxillary gfid mount +TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --attribute-timeout=0 --entry-timeout=0 --aux-gfid-mount + +# create file with specific gfid +uuid=`uuidgen` +EXPECT "File creation OK" python2 $(dirname $0)/../utils/gfid-access.py $M0 ROOT file0 $uuid file + +# check gfid +EXPECT "$uuid" getfattr -m . --only-values -n glusterfs.gfid.string $M0/file0 + +# unmount and mount again so as to start with a fresh inode table +# or use another mount... +TEST umount $M0 +TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --attribute-timeout=0 --entry-timeout=0 --aux-gfid-mount + +# touch the file again (gfid-access.py handles errno) +EXPECT "File creation OK" python2 $(dirname $0)/../utils/gfid-access.py $M0 ROOT file0 $uuid file + +cleanup; -- cgit