summaryrefslogtreecommitdiffstats
path: root/xlators/nfs
diff options
context:
space:
mode:
authorRajesh Amaravathi <rajesh@redhat.com>2012-11-02 16:09:13 +0530
committerVijay Bellur <vbellur@redhat.com>2012-11-18 09:43:04 -0800
commitcb884f7eac134866ca47701d3208055acecbf9a0 (patch)
tree114cbe7699259f4d2335498a6560437c2e8eebac /xlators/nfs
parent1129698a490ac9266b1f613fababdf524e11f887 (diff)
nfs: do not change root inode if enable-ino32 is set
When a user sets nfs.enable-ino32 on, the root inode, which must be 1, is jumbled during hashing of the gfid into 32 bits. This patch avoids doing that, and returns inode of 1 for the root inode. Change-Id: Ib65f2660998a95e1059be32bc298485c5cbe52df BUG: 864222 Signed-off-by: Rajesh Amaravathi <rajesh@redhat.com> Reviewed-on: http://review.gluster.org/4154 Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'xlators/nfs')
-rw-r--r--xlators/nfs/server/src/nfs-common.c3
1 files changed, 3 insertions, 0 deletions
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);