Commit 831804e6 authored by Neil Brown's avatar Neil Brown Committed by Linus Torvalds

[PATCH] knfsd: nfsd4: use the fsid export option when returning the fsid attribute

Return the special NFSv4 pseudo filesystem fsid (0/0) in a GETATTR on an
NFSv4 pseudo filesystem node.
Signed-off-by: default avatarAndy Adamson <andros@citi.umich.edu>
Signed-off-by: default avatarJ. Bruce Fields <bfields@citi.umich.edu>
Signed-off-by: default avatarNeil Brown <neilb@cse.unsw.edu.au>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent ce1bad47
...@@ -1425,7 +1425,7 @@ nfsd4_encode_fattr(struct svc_fh *fhp, struct svc_export *exp, ...@@ -1425,7 +1425,7 @@ nfsd4_encode_fattr(struct svc_fh *fhp, struct svc_export *exp,
if (status) if (status)
goto out_nfserr; goto out_nfserr;
} }
if ((bmval0 & FATTR4_WORD0_FILEHANDLE) && !fhp) { if ((bmval0 & (FATTR4_WORD0_FILEHANDLE | FATTR4_WORD0_FSID)) && !fhp) {
fh_init(&tempfh, NFS4_FHSIZE); fh_init(&tempfh, NFS4_FHSIZE);
status = fh_compose(&tempfh, exp, dentry, NULL); status = fh_compose(&tempfh, exp, dentry, NULL);
if (status) if (status)
...@@ -1508,10 +1508,15 @@ nfsd4_encode_fattr(struct svc_fh *fhp, struct svc_export *exp, ...@@ -1508,10 +1508,15 @@ nfsd4_encode_fattr(struct svc_fh *fhp, struct svc_export *exp,
if (bmval0 & FATTR4_WORD0_FSID) { if (bmval0 & FATTR4_WORD0_FSID) {
if ((buflen -= 16) < 0) if ((buflen -= 16) < 0)
goto out_resource; goto out_resource;
WRITE32(0); if (is_fsid(fhp, rqstp->rq_reffh)) {
WRITE32(MAJOR(stat.dev)); WRITE64((u64)exp->ex_fsid);
WRITE32(0); WRITE64((u64)0);
WRITE32(MINOR(stat.dev)); } else {
WRITE32(0);
WRITE32(MAJOR(stat.dev));
WRITE32(0);
WRITE32(MINOR(stat.dev));
}
} }
if (bmval0 & FATTR4_WORD0_UNIQUE_HANDLES) { if (bmval0 & FATTR4_WORD0_UNIQUE_HANDLES) {
if ((buflen -= 4) < 0) if ((buflen -= 4) < 0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment