|
@@ -2196,11 +2196,14 @@ nfsd4_encode_dirent_fattr(struct nfsd4_readdir *cd,
|
|
|
* we will not follow the cross mount and will fill the attribtutes
|
|
|
* directly from the mountpoint dentry.
|
|
|
*/
|
|
|
- if (d_mountpoint(dentry) && !attributes_need_mount(cd->rd_bmval))
|
|
|
- ignore_crossmnt = 1;
|
|
|
- else if (d_mountpoint(dentry)) {
|
|
|
+ if (nfsd_mountpoint(dentry, exp)) {
|
|
|
int err;
|
|
|
|
|
|
+ if (!(exp->ex_flags & NFSEXP_V4ROOT)
|
|
|
+ && !attributes_need_mount(cd->rd_bmval)) {
|
|
|
+ ignore_crossmnt = 1;
|
|
|
+ goto out_encode;
|
|
|
+ }
|
|
|
/*
|
|
|
* Why the heck aren't we just using nfsd_lookup??
|
|
|
* Different "."/".." handling? Something else?
|
|
@@ -2216,6 +2219,7 @@ nfsd4_encode_dirent_fattr(struct nfsd4_readdir *cd,
|
|
|
goto out_put;
|
|
|
|
|
|
}
|
|
|
+out_encode:
|
|
|
nfserr = nfsd4_encode_fattr(NULL, exp, dentry, p, buflen, cd->rd_bmval,
|
|
|
cd->rd_rqstp, ignore_crossmnt);
|
|
|
out_put:
|