diff options
-rwxr-xr-x | tests/bugs/bug-864222.t | 26 | ||||
-rw-r--r-- | xlators/nfs/server/src/nfs-common.c | 3 |
2 files changed, 29 insertions, 0 deletions
diff --git a/tests/bugs/bug-864222.t b/tests/bugs/bug-864222.t new file mode 100755 index 00000000000..6e02ab60bca --- /dev/null +++ b/tests/bugs/bug-864222.t @@ -0,0 +1,26 @@ +#!/bin/bash + +. $(dirname $0)/../include.rc + +cleanup; + +TEST glusterd +TEST pidof glusterd +TEST $CLI volume create $V0 $H0:$B0/brick0 +TEST $CLI volume start $V0 + +sleep 5 + +TEST mount -t nfs -o vers=3,nolock $H0:/$V0 $N0 +cd $N0 + +TEST ls + +TEST $CLI volume set $V0 nfs.enable-ino32 on +# Main test. This should pass. +TEST ls + +cd +TEST umount $N0 +cleanup + diff --git a/xlators/nfs/server/src/nfs-common.c b/xlators/nfs/server/src/nfs-common.c index 0fe6b34d7d5..b3853ded5fa 100644 --- a/xlators/nfs/server/src/nfs-common.c +++ b/xlators/nfs/server/src/nfs-common.c @@ -417,6 +417,9 @@ nfs_hash_gfid (uuid_t gfid) uint32_t b1 = 0; uint32_t b2 = 0; + if (__is_root_gfid (gfid)) + return 0x1; + memcpy (&msb64, &gfid[8], 8); memcpy (&lsb64, &gfid[0], 8); |