@@ -116,19 +116,11 @@ static __be32 nfsd_setuser_and_check_port(struct svc_rqst *rqstp,
116
116
return nfserrno (nfsd_setuser (& rqstp -> rq_cred , exp ));
117
117
}
118
118
119
- static inline __be32 check_pseudo_root (struct svc_rqst * rqstp ,
120
- struct dentry * dentry , struct svc_export * exp )
119
+ static inline __be32 check_pseudo_root (struct dentry * dentry ,
120
+ struct svc_export * exp )
121
121
{
122
122
if (!(exp -> ex_flags & NFSEXP_V4ROOT ))
123
123
return nfs_ok ;
124
- /*
125
- * v2/v3 clients have no need for the V4ROOT export--they use
126
- * the mount protocl instead; also, further V4ROOT checks may be
127
- * in v4-specific code, in which case v2/v3 clients could bypass
128
- * them.
129
- */
130
- if (!nfsd_v4client (rqstp ))
131
- return nfserr_stale ;
132
124
/*
133
125
* We're exposing only the directories and symlinks that have to be
134
126
* traversed on the way to real exports:
@@ -290,11 +282,15 @@ static __be32 nfsd_set_fh_dentry(struct svc_rqst *rqstp, struct svc_fh *fhp)
290
282
if (dentry -> d_sb -> s_export_op -> flags & EXPORT_OP_NOWCC )
291
283
fhp -> fh_no_wcc = true;
292
284
fhp -> fh_64bit_cookies = true;
285
+ if (exp -> ex_flags & NFSEXP_V4ROOT )
286
+ goto out ;
293
287
break ;
294
288
case 2 :
295
289
fhp -> fh_no_wcc = true;
296
290
if (EX_WGATHER (exp ))
297
291
fhp -> fh_use_wgather = true;
292
+ if (exp -> ex_flags & NFSEXP_V4ROOT )
293
+ goto out ;
298
294
}
299
295
300
296
return 0 ;
@@ -364,7 +360,7 @@ fh_verify(struct svc_rqst *rqstp, struct svc_fh *fhp, umode_t type, int access)
364
360
* (for example, if different id-squashing options are in
365
361
* effect on the new filesystem).
366
362
*/
367
- error = check_pseudo_root (rqstp , dentry , exp );
363
+ error = check_pseudo_root (dentry , exp );
368
364
if (error )
369
365
goto out ;
370
366
0 commit comments