rpms/kernel/devel kernel.spec, 1.1783, 1.1784 linux-2.6-nfsd4-proots.patch, 1.1, 1.2

Steve Dickson steved at fedoraproject.org
Wed Sep 9 19:24:27 UTC 2009


Author: steved

Update of /cvs/pkgs/rpms/kernel/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv3009

Modified Files:
	kernel.spec linux-2.6-nfsd4-proots.patch 
Log Message:
Updated the NFS4 pseudo root code to the latest release.



Index: kernel.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/kernel.spec,v
retrieving revision 1.1783
retrieving revision 1.1784
diff -u -p -r1.1783 -r1.1784
--- kernel.spec	9 Sep 2009 17:16:11 -0000	1.1783
+++ kernel.spec	9 Sep 2009 19:24:26 -0000	1.1784
@@ -2027,6 +2027,9 @@ fi
 # and build.
 
 %changelog
+* Wed Sep  9 2009 Steve Dickson <steved at redhat.com>
+- Updated the NFS4 pseudo root code to the latest release.
+
 * Wed Sep 09 2009 Justin M. Forbes <jforbes at redhat.com>
 - Revert virio_blk to rotational mode. (#509383)
 

linux-2.6-nfsd4-proots.patch:
 fs/nfsd/export.c            |   12 +++++-
 fs/nfsd/nfs4xdr.c           |   83 ++++++++++++++++++++++++++++++++++++--------
 fs/nfsd/nfsfh.c             |   32 ++++++++++++++++
 fs/nfsd/vfs.c               |   75 ++++++++++++++++++++++++++++++++++++++-
 include/linux/nfsd/export.h |    3 +
 include/linux/nfsd/nfsd.h   |    2 +
 6 files changed, 188 insertions(+), 19 deletions(-)

Index: linux-2.6-nfsd4-proots.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/linux-2.6-nfsd4-proots.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -p -r1.1 -r1.2
--- linux-2.6-nfsd4-proots.patch	8 Jul 2009 13:27:06 -0000	1.1
+++ linux-2.6-nfsd4-proots.patch	9 Sep 2009 19:24:27 -0000	1.2
@@ -1,6 +1,6 @@
 diff -up linux-2.6.30.noarch/fs/nfsd/export.c.save linux-2.6.30.noarch/fs/nfsd/export.c
---- linux-2.6.30.noarch/fs/nfsd/export.c.save	2009-07-02 11:34:38.000000000 -0400
-+++ linux-2.6.30.noarch/fs/nfsd/export.c	2009-07-02 11:35:44.000000000 -0400
+--- linux-2.6.30.noarch/fs/nfsd/export.c.save	2009-09-09 15:11:54.702436000 -0400
++++ linux-2.6.30.noarch/fs/nfsd/export.c	2009-09-09 15:12:44.520167000 -0400
 @@ -104,6 +104,7 @@ static int expkey_parse(struct cache_det
  	if (mesg[mlen-1] != '\n')
  		return -EINVAL;
@@ -64,9 +64,9 @@ diff -up linux-2.6.30.noarch/fs/nfsd/exp
  		return 0;
  	}
 diff -up linux-2.6.30.noarch/fs/nfsd/nfs4xdr.c.save linux-2.6.30.noarch/fs/nfsd/nfs4xdr.c
---- linux-2.6.30.noarch/fs/nfsd/nfs4xdr.c.save	2009-07-02 11:34:38.000000000 -0400
-+++ linux-2.6.30.noarch/fs/nfsd/nfs4xdr.c	2009-07-02 11:35:31.000000000 -0400
-@@ -2176,28 +2176,62 @@ static inline int attributes_need_mount(
+--- linux-2.6.30.noarch/fs/nfsd/nfs4xdr.c.save	2009-09-09 15:11:54.707433000 -0400
++++ linux-2.6.30.noarch/fs/nfsd/nfs4xdr.c	2009-09-09 15:12:36.408695000 -0400
+@@ -2176,28 +2176,61 @@ static inline int attributes_need_mount(
  	return 0;
  }
  
@@ -136,49 +136,11 @@ diff -up linux-2.6.30.noarch/fs/nfsd/nfs
 +	struct svc_export *exp = cd->rd_fhp->fh_export;
 +	__be32 nfserr;
 +	int ignore_crossmnt = 0;
-+	int err, v4root = (exp->ex_flags & NFSEXP_V4ROOT);
 +
  	exp_get(exp);
  	/*
  	 * In the case of a mountpoint, the client may be asking for
-@@ -2208,18 +2242,29 @@ nfsd4_encode_dirent_fattr(struct nfsd4_r
- 	 */
- 	if (d_mountpoint(dentry) && !attributes_need_mount(cd->rd_bmval))
- 		ignore_crossmnt = 1;
--	else if (d_mountpoint(dentry)) {
--		int err;
--
-+	else if (d_mountpoint(dentry) || v4root) {
-+		/*
-+		 * Make sure the dentry is viewable on the psuedo export
-+		 */
-+		v4root = (dentry->d_inode && v4root);
-+		if (v4root) {
-+			err = nfsd_export_lookup(cd->rd_rqstp, dentry, exp);
-+			if (err) {
-+				nfserr = nfserrno(err);
-+				goto out_put;
-+			}
-+		}
- 		/*
- 		 * Why the heck aren't we just using nfsd_lookup??
- 		 * Different "."/".." handling?  Something else?
- 		 * At least, add a comment here to explain....
- 		 */
--		err = nfsd_cross_mnt(cd->rd_rqstp, &dentry, &exp);
--		if (err) {
--			nfserr = nfserrno(err);
--			goto out_put;
-+		if (d_mountpoint(dentry) || v4root) {
-+			err = nfsd_cross_mnt(cd->rd_rqstp, &dentry, &exp);
-+			if (err) {
-+				nfserr = nfserrno(err);
-+				goto out_put;
-+			}
- 		}
- 		nfserr = check_nfsd_access(exp, cd->rd_rqstp);
- 		if (nfserr)
-@@ -2258,6 +2303,7 @@ nfsd4_encode_dirent(void *ccdv, const ch
+@@ -2258,6 +2291,7 @@ nfsd4_encode_dirent(void *ccdv, const ch
  	struct readdir_cd *ccd = ccdv;
  	struct nfsd4_readdir *cd = container_of(ccd, struct nfsd4_readdir, common);
  	int buflen;
@@ -186,7 +148,7 @@ diff -up linux-2.6.30.noarch/fs/nfsd/nfs
  	__be32 *p = cd->buffer;
  	__be32 *cookiep;
  	__be32 nfserr = nfserr_toosmall;
-@@ -2268,19 +2314,40 @@ nfsd4_encode_dirent(void *ccdv, const ch
+@@ -2268,19 +2302,40 @@ nfsd4_encode_dirent(void *ccdv, const ch
  		return 0;
  	}
  
@@ -230,17 +192,15 @@ diff -up linux-2.6.30.noarch/fs/nfsd/nfs
  	case nfs_ok:
  		p += buflen;
 diff -up linux-2.6.30.noarch/fs/nfsd/nfsfh.c.save linux-2.6.30.noarch/fs/nfsd/nfsfh.c
---- linux-2.6.30.noarch/fs/nfsd/nfsfh.c.save	2009-07-02 11:34:38.000000000 -0400
-+++ linux-2.6.30.noarch/fs/nfsd/nfsfh.c	2009-07-02 11:35:48.000000000 -0400
-@@ -109,6 +109,34 @@ static __be32 nfsd_setuser_and_check_por
+--- linux-2.6.30.noarch/fs/nfsd/nfsfh.c.save	2009-09-09 15:11:54.711427000 -0400
++++ linux-2.6.30.noarch/fs/nfsd/nfsfh.c	2009-09-09 15:12:48.357903000 -0400
+@@ -109,6 +109,30 @@ static __be32 nfsd_setuser_and_check_por
  	return nfserrno(nfsd_setuser(rqstp, exp));
  }
  
 +static inline __be32 check_pseudo_root(struct svc_rqst *rqstp,
 +	struct dentry *dentry, struct svc_export *exp)
 +{
-+	int error;
-+
 +	/*
 +	 * Only interested in pseudo roots
 +	 */
@@ -252,14 +212,12 @@ diff -up linux-2.6.30.noarch/fs/nfsd/nfs
 +	 */
 +	if (unlikely(!S_ISDIR(dentry->d_inode->i_mode)))
 +		return nfserr_stale;
++
 +	/*
-+	 * Check non-root directories to make sure
-+	 * they are truly exported
++	 * Make sure the export is the parent of the dentry
 +	 */
-+	if (unlikely(dentry->d_name.len > 1)) {
-+		error = nfsd_export_lookup(rqstp, dentry, exp);
-+		return nfserrno(error);
-+	}
++	if (unlikely(dentry->d_parent != exp->ex_path.dentry))
++		return nfserr_stale;
 +
 +	return nfs_ok;
 +}
@@ -267,7 +225,7 @@ diff -up linux-2.6.30.noarch/fs/nfsd/nfs
  /*
   * Use the given filehandle to look up the corresponding export and
   * dentry.  On success, the results are used to set fh_export and
-@@ -315,6 +343,14 @@ fh_verify(struct svc_rqst *rqstp, struct
+@@ -315,6 +339,14 @@ fh_verify(struct svc_rqst *rqstp, struct
  		error = nfsd_setuser_and_check_port(rqstp, exp);
  		if (error)
  			goto out;
@@ -283,8 +241,8 @@ diff -up linux-2.6.30.noarch/fs/nfsd/nfs
  
  	error = nfsd_mode_check(rqstp, dentry->d_inode->i_mode, type);
 diff -up linux-2.6.30.noarch/fs/nfsd/vfs.c.save linux-2.6.30.noarch/fs/nfsd/vfs.c
---- linux-2.6.30.noarch/fs/nfsd/vfs.c.save	2009-07-02 11:34:38.000000000 -0400
-+++ linux-2.6.30.noarch/fs/nfsd/vfs.c	2009-07-02 11:35:39.000000000 -0400
+--- linux-2.6.30.noarch/fs/nfsd/vfs.c.save	2009-09-09 15:11:54.715423000 -0400
++++ linux-2.6.30.noarch/fs/nfsd/vfs.c	2009-09-09 15:12:39.978431000 -0400
 @@ -89,6 +89,12 @@ struct raparm_hbucket {
  #define RAPARM_HASH_MASK	(RAPARM_HASH_SIZE-1)
  static struct raparm_hbucket	raparm_hash[RAPARM_HASH_SIZE];
@@ -314,7 +272,7 @@ diff -up linux-2.6.30.noarch/fs/nfsd/vfs
  
 +/*
 + * Lookup the export the dentry is on. To be
-+ * viewable on an pseudo export, the dentry
++ * viewable on a pseudo export, the dentry
 + * has to be an exported directory. 
 + */
 +int
@@ -325,14 +283,14 @@ diff -up linux-2.6.30.noarch/fs/nfsd/vfs
 +	struct path path;
 +	int err = 0;
 +
-+	if ((exp->ex_flags & NFSEXP_V4ROOT) == 0)
++	if (exp->ex_flags & NFSEXP_V4ROOT) == 0)
 +		return 0;
 +
 +	/*
 +	 * Make sure the export is the parent of the dentry
 +	 */
-+	if (dentry->d_parent != exp->ex_path.dentry)
-+		return 0;
++	if (unlikely(dentry->d_parent != exp->ex_path.dentry))
++		return -ENOENT;
 +
 +	/*
 +	 * Only directories are seen on psuedo exports
@@ -405,8 +363,8 @@ diff -up linux-2.6.30.noarch/fs/nfsd/vfs
  				dput(dentry);
  				goto out_nfserr;
 diff -up linux-2.6.30.noarch/include/linux/nfsd/export.h.save linux-2.6.30.noarch/include/linux/nfsd/export.h
---- linux-2.6.30.noarch/include/linux/nfsd/export.h.save	2009-07-02 11:34:38.000000000 -0400
-+++ linux-2.6.30.noarch/include/linux/nfsd/export.h	2009-07-02 11:35:22.000000000 -0400
+--- linux-2.6.30.noarch/include/linux/nfsd/export.h.save	2009-09-09 15:11:54.719419000 -0400
++++ linux-2.6.30.noarch/include/linux/nfsd/export.h	2009-09-09 15:12:29.064157000 -0400
 @@ -39,7 +39,8 @@
  #define NFSEXP_FSID		0x2000
  #define	NFSEXP_CROSSMOUNT	0x4000
@@ -418,8 +376,8 @@ diff -up linux-2.6.30.noarch/include/lin
  /* The flags that may vary depending on security flavor: */
  #define NFSEXP_SECINFO_FLAGS	(NFSEXP_READONLY | NFSEXP_ROOTSQUASH \
 diff -up linux-2.6.30.noarch/include/linux/nfsd/nfsd.h.save linux-2.6.30.noarch/include/linux/nfsd/nfsd.h
---- linux-2.6.30.noarch/include/linux/nfsd/nfsd.h.save	2009-07-02 11:34:38.000000000 -0400
-+++ linux-2.6.30.noarch/include/linux/nfsd/nfsd.h	2009-07-02 11:35:27.000000000 -0400
+--- linux-2.6.30.noarch/include/linux/nfsd/nfsd.h.save	2009-09-09 15:11:54.723415000 -0400
++++ linux-2.6.30.noarch/include/linux/nfsd/nfsd.h	2009-09-09 15:12:33.025896000 -0400
 @@ -76,6 +76,8 @@ int		nfsd_racache_init(int);
  void		nfsd_racache_shutdown(void);
  int		nfsd_cross_mnt(struct svc_rqst *rqstp, struct dentry **dpp,




More information about the scm-commits mailing list