diff options
author | Michael Brown <michael@netdirect.ca> | 2013-04-30 11:34:57 -0400 |
---|---|---|
committer | Anand Avati <avati@redhat.com> | 2013-05-01 03:12:06 -0700 |
commit | 39a1eaf38d64f66dfa74c6843dc9266f40dd4645 (patch) | |
tree | 649f1174f64b02074fe2f04a9031db3ab7dc6486 /xlators/nfs/server/src/nfs3-fh.c | |
parent | d57e37a5235d8ddafa67d4b4e4dca5f3c2126591 (diff) |
Expand gluster's NFS FD header to 4 bytes
* https://bugzilla.redhat.com/show_bug.cgi?id=950121
* Oracle's DNFS does not properly XDR encoding on NFS FDs that
are not congruent to 0mod4 bytes long
* This patch is a workaround to support Oracle's buggy code
Change-Id: Ic621e2cd679a86aa9a06ed9ca684925e1e0ec43f
BUG: 950121
Signed-off-by: Michael Brown <michael@netdirect.ca>
Reviewed-on: http://review.gluster.org/4918
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
Diffstat (limited to 'xlators/nfs/server/src/nfs3-fh.c')
-rw-r--r-- | xlators/nfs/server/src/nfs3-fh.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/xlators/nfs/server/src/nfs3-fh.c b/xlators/nfs/server/src/nfs3-fh.c index eb822392476..c4f59a622c4 100644 --- a/xlators/nfs/server/src/nfs3-fh.c +++ b/xlators/nfs/server/src/nfs3-fh.c @@ -46,6 +46,12 @@ nfs3_fh_validate (struct nfs3_fh *fh) if (fh->ident[1] != GF_NFSFH_IDENT1) return 0; + if (fh->ident[2] != GF_NFSFH_IDENT2) + return 0; + + if (fh->ident[3] != GF_NFSFH_IDENT3) + return 0; + return 1; } @@ -58,6 +64,8 @@ nfs3_fh_init (struct nfs3_fh *fh, struct iatt *buf) fh->ident[0] = GF_NFSFH_IDENT0; fh->ident[1] = GF_NFSFH_IDENT1; + fh->ident[2] = GF_NFSFH_IDENT2; + fh->ident[3] = GF_NFSFH_IDENT3; uuid_copy (fh->gfid, buf->ia_gfid); } @@ -161,6 +169,8 @@ nfs3_build_fh (inode_t *inode, uuid_t exportid, struct nfs3_fh *newfh) newfh->ident[0] = GF_NFSFH_IDENT0; newfh->ident[1] = GF_NFSFH_IDENT1; + newfh->ident[2] = GF_NFSFH_IDENT2; + newfh->ident[3] = GF_NFSFH_IDENT3; uuid_copy (newfh->gfid, inode->gfid); uuid_copy (newfh->exportid, exportid); return 0; |