Label NFS port to Fedora 3.7.0-0.rc7.git1.2.fc19

Signed-off-by: Steve Dickson <steved@redhat.com>
This commit is contained in:
Steve Dickson 2012-12-04 10:39:29 -05:00
parent 0defb6af7b
commit 838e4208cc
5 changed files with 4054 additions and 2 deletions

View File

@ -3652,6 +3652,7 @@ CONFIG_NFS_V4=y
# CONFIG_NFS_SWAP is not set
CONFIG_NFS_V4_1=y
CONFIG_NFS_V4_1_IMPLEMENTATION_ID_DOMAIN="kernel.org"
NFS_V4_SECURITY_LABEL=y
CONFIG_NFSD=m
CONFIG_NFSD_V3=y
CONFIG_NFSD_V3_ACL=y

View File

@ -123,4 +123,4 @@ CONFIG_BPF_JIT=y
# Should be 32bit only, but lacks KConfig depends
# CONFIG_XO15_EBOOK is not set
CONFIG_NFS_V4_SECURITY_LABEL=y

View File

@ -31,7 +31,7 @@ Summary: The Linux kernel
#
# (Uncomment the '#' and both spaces below to set the buildid.)
#
# % define buildid .local
%define buildid .lnfs37rc2
###################################################################
# The buildid can also be specified on the rpmbuild command line
@ -719,6 +719,8 @@ Patch2901: linux-2.6-v4l-dvb-experimental.patch
# fs fixes
# NFSv4
Patch3000: lnfs-3.7.0-0.rc7.git1.2.fc19.patch
Patch3001: lnfs-unset-3.7.0-0.rc7.git1.2.fc19.patch
# patches headed upstream
Patch10000: fs-proc-devtree-remove_proc_entry.patch
@ -1370,6 +1372,8 @@ ApplyPatch arm-tegra-sdhci-module-fix.patch
# eCryptfs
# NFSv4
ApplyPatch lnfs-3.7.0-0.rc7.git1.2.fc19.patch
ApplyPatch lnfs-unset-3.7.0-0.rc7.git1.2.fc19.patch
# USB

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,124 @@
diff -up linux-3.7.0-0.rc7.git1.2.lnfs37rc2.fc17.x86_64/fs/nfs/nfs4proc.c.orig linux-3.7.0-0.rc7.git1.2.lnfs37rc2.fc17.x86_64/fs/nfs/nfs4proc.c
--- linux-3.7.0-0.rc7.git1.2.lnfs37rc2.fc17.x86_64/fs/nfs/nfs4proc.c.orig 2012-12-03 10:58:51.086841436 -0500
+++ linux-3.7.0-0.rc7.git1.2.lnfs37rc2.fc17.x86_64/fs/nfs/nfs4proc.c 2012-12-03 11:34:01.065752872 -0500
@@ -925,8 +925,8 @@ err_free_label:
#ifdef CONFIG_NFS_V4_SECURITY_LABEL
if (server->caps & NFS_CAP_SECURITY_LABEL)
nfs4_label_free(p->f_label);
-#endif
err_free_p:
+#endif
kfree(p);
err:
dput(parent);
@@ -2440,9 +2440,10 @@ static struct inode *
nfs4_atomic_open(struct inode *dir, struct nfs_open_context *ctx, int open_flags, struct iattr *attr)
{
struct nfs4_state *state;
- struct nfs4_label l, *label = NULL;
-
+ struct nfs4_label *label = NULL;
#ifdef CONFIG_NFS_V4_SECURITY_LABEL
+ struct nfs4_label l;
+
if (nfs_server_capable(dir, NFS_CAP_SECURITY_LABEL)) {
struct dentry *dentry = ctx->dentry;
int error;
@@ -3028,8 +3029,8 @@ static int _nfs4_proc_access(struct inod
#ifdef CONFIG_NFS_V4_SECURITY_LABEL
if (server->caps & NFS_CAP_SECURITY_LABEL)
nfs4_label_free(res.label);
-#endif
out:
+#endif
nfs_free_fattr(res.fattr);
return status;
}
@@ -3107,7 +3108,10 @@ static int
nfs4_proc_create(struct inode *dir, struct dentry *dentry, struct iattr *sattr,
int flags)
{
- struct nfs4_label l, *ilabel = NULL;
+ struct nfs4_label *ilabel = NULL;
+#ifdef CONFIG_NFS_V4_SECURITY_LABEL
+ struct nfs4_label l;
+#endif
struct nfs_open_context *ctx;
struct nfs4_state *state;
int status = 0;
@@ -3300,8 +3304,8 @@ static int _nfs4_proc_rename(struct inod
nfs4_label_free(res.old_label);
nfs4_label_free(res.new_label);
}
-#endif
out:
+#endif
return status;
}
@@ -3420,7 +3424,9 @@ static struct nfs4_createdata *nfs4_allo
nfs_fattr_init(data->res.fattr);
}
return data;
+#ifdef CONFIG_NFS_V4_SECURITY_LABEL
out_free:
+#endif
kfree(data);
return NULL;
}
@@ -3476,11 +3482,11 @@ static int nfs4_proc_symlink(struct inod
struct page *page, unsigned int len, struct iattr *sattr)
{
struct nfs4_exception exception = { };
- struct nfs4_label l, *label = NULL;
int err;
-
-
+ struct nfs4_label *label = NULL;
#ifdef CONFIG_NFS_V4_SECURITY_LABEL
+ struct nfs4_label l;
+
if (nfs_server_capable(dir, NFS_CAP_SECURITY_LABEL)) {
err = security_dentry_init_security(dentry, sattr->ia_mode,
&dentry->d_name, &l.label, &l.len);
@@ -3524,7 +3530,10 @@ static int nfs4_proc_mkdir(struct inode
struct iattr *sattr)
{
struct nfs4_exception exception = { };
- struct nfs4_label l, *label = NULL;
+ struct nfs4_label *label = NULL;
+#ifdef CONFIG_NFS_V4_SECURITY_LABEL
+ struct nfs4_label l;
+#endif
int err;
#ifdef CONFIG_NFS_V4_SECURITY_LABEL
@@ -3642,9 +3651,12 @@ out:
static int nfs4_proc_mknod(struct inode *dir, struct dentry *dentry,
struct iattr *sattr, dev_t rdev)
{
- struct nfs4_exception exception = { };
- struct nfs4_label l, *label = NULL;
int err;
+ struct nfs4_exception exception = { };
+ struct nfs4_label *label = NULL;
+#ifdef CONFIG_NFS_V4_SECURITY_LABEL
+ struct nfs4_label l;
+#endif
#ifdef CONFIG_NFS_V4_SECURITY_LABEL
if (nfs_server_capable(dir, NFS_CAP_SECURITY_LABEL)) {
diff -up linux-3.7.0-0.rc7.git1.2.lnfs37rc2.fc17.x86_64/include/linux/nfs_fs.h.orig linux-3.7.0-0.rc7.git1.2.lnfs37rc2.fc17.x86_64/include/linux/nfs_fs.h
--- linux-3.7.0-0.rc7.git1.2.lnfs37rc2.fc17.x86_64/include/linux/nfs_fs.h.orig 2012-12-03 11:08:32.524060597 -0500
+++ linux-3.7.0-0.rc7.git1.2.lnfs37rc2.fc17.x86_64/include/linux/nfs_fs.h 2012-12-03 11:09:38.431071109 -0500
@@ -502,8 +502,8 @@ extern void nfs4_label_init(struct nfs4_
extern void nfs4_label_free(struct nfs4_label *);
#else
static inline struct nfs4_label *nfs4_label_alloc(gfp_t flags) { return NULL; }
-static inline void nfs4_label_init(struct nfs4_label *) {}
-static inline void nfs4_label_free(struct nfs4_label *label) {}
+static inline void nfs4_label_init(void *label) {}
+static inline void nfs4_label_free(void *label) {}
#endif
/*