diff options
author | Shehjar Tikoo <shehjart@gluster.com> | 2010-11-03 06:35:27 +0000 |
---|---|---|
committer | Anand V. Avati <avati@dev.gluster.com> | 2010-11-03 21:36:51 -0700 |
commit | d6d7a85487d8ec8017d1d13aa36642ad0355b3e4 (patch) | |
tree | 19afd12a6943d9490ff3116e44ff211238e788c9 /xlators/nfs/server/src/nfs3-fh.c | |
parent | 5afc77d585c480f185dd7b24b753a6924218bb86 (diff) |
nfs3: More robust root gfid checks
Signed-off-by: Shehjar Tikoo <shehjart@gluster.com>
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
BUG: 2051 (find fails with loop detected error)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2051
Diffstat (limited to 'xlators/nfs/server/src/nfs3-fh.c')
-rw-r--r-- | xlators/nfs/server/src/nfs3-fh.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/xlators/nfs/server/src/nfs3-fh.c b/xlators/nfs/server/src/nfs3-fh.c index 2239148c15e..49236d609f8 100644 --- a/xlators/nfs/server/src/nfs3-fh.c +++ b/xlators/nfs/server/src/nfs3-fh.c @@ -68,10 +68,12 @@ nfs3_fh_build_indexed_root_fh (xlator_list_t *cl, xlator_t *xl) { struct nfs3_fh fh = {{0}, }; struct iatt buf = {0, }; + uuid_t root = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1}; + if ((!cl) || (!xl)) return fh; - buf.ia_gfid[15] = 1; + uuid_copy (buf.ia_gfid, root); nfs3_fh_init (&fh, &buf); fh.exportid [15] = nfs_xlator_to_xlid (cl, xl); @@ -84,8 +86,9 @@ nfs3_fh_build_uuid_root_fh (uuid_t volumeid) { struct nfs3_fh fh = {{0}, }; struct iatt buf = {0, }; + uuid_t root = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1}; - buf.ia_gfid[15] = 1; + uuid_copy (buf.ia_gfid, root); nfs3_fh_init (&fh, &buf); uuid_copy (fh.exportid, volumeid); @@ -96,12 +99,11 @@ nfs3_fh_build_uuid_root_fh (uuid_t volumeid) int nfs3_fh_is_root_fh (struct nfs3_fh *fh) { - uuid_t rootgfid = {0, 1}; + uuid_t rootgfid = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1}; if (!fh) return 0; - rootgfid[15] = 1; if (uuid_compare (fh->gfid, rootgfid) == 0) return 1; |