From fe2777ccaff5d2660af65472962bbef8d10b1814 Mon Sep 17 00:00:00 2001 From: Shehjar Tikoo Date: Tue, 5 Oct 2010 01:58:46 +0000 Subject: nfs3: Convert gfid to ino only for non-root Signed-off-by: Shehjar Tikoo Signed-off-by: Vijay Bellur BUG: 1724 (kernel untar fails during add-brick) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1724 --- xlators/nfs/server/src/nfs3-helpers.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'xlators') diff --git a/xlators/nfs/server/src/nfs3-helpers.c b/xlators/nfs/server/src/nfs3-helpers.c index 1a229af0a..2e0274624 100644 --- a/xlators/nfs/server/src/nfs3-helpers.c +++ b/xlators/nfs/server/src/nfs3-helpers.c @@ -94,10 +94,15 @@ struct nfs3stat_strerror nfs3stat_strerror_table[] = { uint64_t nfs3_iatt_gfid_to_ino (struct iatt *buf) { + uint64_t ino = 0; + if (!buf) return 0; - memcpy (&buf->ia_ino, &buf->ia_gfid[8], sizeof (uint64_t)); + if (buf->ia_ino != 1) + memcpy (&buf->ia_ino, &buf->ia_gfid[8], sizeof (uint64_t)); + else + ino = 1; return buf->ia_ino; } -- cgit