diff mbox

lnfs: Cleaned up compile warnings when NFS_V4_SECURITY_LABEL is not set.

Message ID 1354566254-546-1-git-send-email-steved@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Steve Dickson Dec. 3, 2012, 8:24 p.m. UTC
This patch cleans up a number compile warnings when the
label NFS code exists but is not configured to compile.

Signed-off-by: Steve Dickson <steved@redhat.com>
---
 fs/nfs/nfs4proc.c      | 36 ++++++++++++++++++++++++------------
 include/linux/nfs_fs.h |  4 ++--
 2 files changed, 26 insertions(+), 14 deletions(-)

Comments

Dave Quigley Dec. 3, 2012, 9:18 p.m. UTC | #1
On 12/03/2012 15:24, Steve Dickson wrote:
> This patch cleans up a number compile warnings when the
> label NFS code exists but is not configured to compile.
>
> Signed-off-by: Steve Dickson <steved@redhat.com>
> ---
>  fs/nfs/nfs4proc.c      | 36 ++++++++++++++++++++++++------------
>  include/linux/nfs_fs.h |  4 ++--
>  2 files changed, 26 insertions(+), 14 deletions(-)
>
> diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
> index 2c8dd55..02e3303 100644
> --- a/fs/nfs/nfs4proc.c
> +++ b/fs/nfs/nfs4proc.c
> @@ -926,8 +926,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);
> @@ -2438,9 +2438,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;
> @@ -3026,8 +3027,8 @@ static int _nfs4_proc_access(struct inode
> *inode, struct nfs_access_entry *entry
>  #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;
>  }
> @@ -3105,7 +3106,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;
> @@ -3298,8 +3302,8 @@ static int _nfs4_proc_rename(struct inode
> *old_dir, struct qstr *old_name,
>  		nfs4_label_free(res.old_label);
>  		nfs4_label_free(res.new_label);
>  	}
> -#endif
>  out:
> +#endif
>  	return status;
>  }
>
> @@ -3418,7 +3422,9 @@ static struct nfs4_createdata
> *nfs4_alloc_createdata(struct inode *dir,
>  		nfs_fattr_init(data->res.fattr);
>  	}
>  	return data;
> +#ifdef CONFIG_NFS_V4_SECURITY_LABEL
>  out_free:
> +#endif
>  	kfree(data);
>  	return NULL;
>  }
> @@ -3474,11 +3480,11 @@ static int nfs4_proc_symlink(struct inode
> *dir, struct dentry *dentry,
>  		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);
> @@ -3522,7 +3528,10 @@ static int nfs4_proc_mkdir(struct inode *dir,
> struct dentry *dentry,
>  		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
> @@ -3640,9 +3649,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 --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h
> index 2ef01f8..f4bb5c4 100644
> --- a/include/linux/nfs_fs.h
> +++ b/include/linux/nfs_fs.h
> @@ -502,8 +502,8 @@ extern void nfs4_label_init(struct nfs4_label *);
>  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
>
>  /*

Thanks for the patch. The question I have here is should I tag Steve's 
patch on the end of the patch set or should I integrate it back into the 
original patches?

Dave
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Trond Myklebust Dec. 3, 2012, 9:24 p.m. UTC | #2
T24gTW9uLCAyMDEyLTEyLTAzIGF0IDE2OjE4IC0wNTAwLCBEYXZpZCBRdWlnbGV5IHdyb3RlOg0K
PiB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LXN0YXRpYyBpbmxpbmUgdm9p
ZCBuZnM0X2xhYmVsX2ZyZWUoc3RydWN0IG5mczRfbGFiZWwgKmxhYmVsKSB7fQ0KPiA+ICtzdGF0
aWMgaW5saW5lIHZvaWQgbmZzNF9sYWJlbF9pbml0KHZvaWQgKmxhYmVsKSB7fQ0KPiA+ICtzdGF0
aWMgaW5saW5lIHZvaWQgbmZzNF9sYWJlbF9mcmVlKHZvaWQgKmxhYmVsKSB7fQ0KPiA+ICAjZW5k
aWYNCj4gPg0KPiA+ICAvKg0KPiANCj4gVGhhbmtzIGZvciB0aGUgcGF0Y2guIFRoZSBxdWVzdGlv
biBJIGhhdmUgaGVyZSBpcyBzaG91bGQgSSB0YWcgU3RldmUncyANCj4gcGF0Y2ggb24gdGhlIGVu
ZCBvZiB0aGUgcGF0Y2ggc2V0IG9yIHNob3VsZCBJIGludGVncmF0ZSBpdCBiYWNrIGludG8gdGhl
IA0KPiBvcmlnaW5hbCBwYXRjaGVzPw0KDQpJdCBpcyB1cCB0byB5b3UsIGhvd2V2ZXIgaXQgd291
bGQgYmUgbmljZSB0byBoYXZlIHRoZSBmaW5hbCBwYXRjaCBzZXJpZXMNCmJlIGZ1bGx5IGJpc2Vj
dGlibGUuDQoNCkNoZWVycw0KICBUcm9uZA0KLS0gDQpUcm9uZCBNeWtsZWJ1c3QNCkxpbnV4IE5G
UyBjbGllbnQgbWFpbnRhaW5lcg0KDQpOZXRBcHANClRyb25kLk15a2xlYnVzdEBuZXRhcHAuY29t
DQp3d3cubmV0YXBwLmNvbQ0K
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Dave Quigley Dec. 3, 2012, 9:35 p.m. UTC | #3
On 12/03/2012 16:24, Myklebust, Trond wrote:
> On Mon, 2012-12-03 at 16:18 -0500, David Quigley wrote:
>> On 12/03/2012 15:24, Steve Dickson wrote:
>> > This patch cleans up a number compile warnings when the
>> > label NFS code exists but is not configured to compile.
>> >
>> > Signed-off-by: Steve Dickson <steved@redhat.com>
>> > ---
>> >  fs/nfs/nfs4proc.c      | 36 ++++++++++++++++++++++++------------
>> >  include/linux/nfs_fs.h |  4 ++--
>> >  2 files changed, 26 insertions(+), 14 deletions(-)
>> >
>> > diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
>> > index 2c8dd55..02e3303 100644
>> > --- a/fs/nfs/nfs4proc.c
>> > +++ b/fs/nfs/nfs4proc.c
>> > @@ -926,8 +926,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);
>> > @@ -2438,9 +2438,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;
>> > @@ -3026,8 +3027,8 @@ static int _nfs4_proc_access(struct inode
>> > *inode, struct nfs_access_entry *entry
>> >  #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;
>> >  }
>> > @@ -3105,7 +3106,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;
>> > @@ -3298,8 +3302,8 @@ static int _nfs4_proc_rename(struct inode
>> > *old_dir, struct qstr *old_name,
>> >  		nfs4_label_free(res.old_label);
>> >  		nfs4_label_free(res.new_label);
>> >  	}
>> > -#endif
>> >  out:
>> > +#endif
>> >  	return status;
>> >  }
>> >
>> > @@ -3418,7 +3422,9 @@ static struct nfs4_createdata
>> > *nfs4_alloc_createdata(struct inode *dir,
>> >  		nfs_fattr_init(data->res.fattr);
>> >  	}
>> >  	return data;
>> > +#ifdef CONFIG_NFS_V4_SECURITY_LABEL
>> >  out_free:
>> > +#endif
>> >  	kfree(data);
>> >  	return NULL;
>> >  }
>> > @@ -3474,11 +3480,11 @@ static int nfs4_proc_symlink(struct inode
>> > *dir, struct dentry *dentry,
>> >  		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);
>> > @@ -3522,7 +3528,10 @@ static int nfs4_proc_mkdir(struct inode 
>> *dir,
>> > struct dentry *dentry,
>> >  		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
>> > @@ -3640,9 +3649,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 --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h
>> > index 2ef01f8..f4bb5c4 100644
>> > --- a/include/linux/nfs_fs.h
>> > +++ b/include/linux/nfs_fs.h
>> > @@ -502,8 +502,8 @@ extern void nfs4_label_init(struct nfs4_label 
>> *);
>> >  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
>> >
>> >  /*
>>
>> Thanks for the patch. The question I have here is should I tag 
>> Steve's
>> patch on the end of the patch set or should I integrate it back into 
>> the
>> original patches?
>
> It is up to you, however it would be nice to have the final patch 
> series
> be fully bisectible.
>
> Cheers
>   Trond

Is it not currently bisectible? Before I release I apply each patch one 
by one and compile between them to make sure they build. Has anyone had 
problems with it not bisecting properly?
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Trond Myklebust Dec. 3, 2012, 9:41 p.m. UTC | #4
On Mon, 2012-12-03 at 16:35 -0500, David Quigley wrote:
> On 12/03/2012 16:24, Myklebust, Trond wrote:

> > On Mon, 2012-12-03 at 16:18 -0500, David Quigley wrote:

> >> On 12/03/2012 15:24, Steve Dickson wrote:

> >> > This patch cleans up a number compile warnings when the

> >> > label NFS code exists but is not configured to compile.

> >> >

> >> > Signed-off-by: Steve Dickson <steved@redhat.com>

> >> > ---

> >> >  fs/nfs/nfs4proc.c      | 36 ++++++++++++++++++++++++------------

> >> >  include/linux/nfs_fs.h |  4 ++--

> >> >  2 files changed, 26 insertions(+), 14 deletions(-)

> >> >

> >> > diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c

> >> > index 2c8dd55..02e3303 100644

> >> > --- a/fs/nfs/nfs4proc.c

> >> > +++ b/fs/nfs/nfs4proc.c

> >> > @@ -926,8 +926,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);

> >> > @@ -2438,9 +2438,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;

> >> > @@ -3026,8 +3027,8 @@ static int _nfs4_proc_access(struct inode

> >> > *inode, struct nfs_access_entry *entry

> >> >  #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;

> >> >  }

> >> > @@ -3105,7 +3106,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;

> >> > @@ -3298,8 +3302,8 @@ static int _nfs4_proc_rename(struct inode

> >> > *old_dir, struct qstr *old_name,

> >> >  		nfs4_label_free(res.old_label);

> >> >  		nfs4_label_free(res.new_label);

> >> >  	}

> >> > -#endif

> >> >  out:

> >> > +#endif

> >> >  	return status;

> >> >  }

> >> >

> >> > @@ -3418,7 +3422,9 @@ static struct nfs4_createdata

> >> > *nfs4_alloc_createdata(struct inode *dir,

> >> >  		nfs_fattr_init(data->res.fattr);

> >> >  	}

> >> >  	return data;

> >> > +#ifdef CONFIG_NFS_V4_SECURITY_LABEL

> >> >  out_free:

> >> > +#endif

> >> >  	kfree(data);

> >> >  	return NULL;

> >> >  }

> >> > @@ -3474,11 +3480,11 @@ static int nfs4_proc_symlink(struct inode

> >> > *dir, struct dentry *dentry,

> >> >  		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);

> >> > @@ -3522,7 +3528,10 @@ static int nfs4_proc_mkdir(struct inode 

> >> *dir,

> >> > struct dentry *dentry,

> >> >  		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

> >> > @@ -3640,9 +3649,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 --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h

> >> > index 2ef01f8..f4bb5c4 100644

> >> > --- a/include/linux/nfs_fs.h

> >> > +++ b/include/linux/nfs_fs.h

> >> > @@ -502,8 +502,8 @@ extern void nfs4_label_init(struct nfs4_label 

> >> *);

> >> >  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

> >> >

> >> >  /*

> >>

> >> Thanks for the patch. The question I have here is should I tag 

> >> Steve's

> >> patch on the end of the patch set or should I integrate it back into 

> >> the

> >> original patches?

> >

> > It is up to you, however it would be nice to have the final patch 

> > series

> > be fully bisectible.

> >

> > Cheers

> >   Trond

> 

> Is it not currently bisectible? Before I release I apply each patch one 

> by one and compile between them to make sure they build. Has anyone had 

> problems with it not bisecting properly?


Never mind; I misread "compiler warnings" as referring to compiler
errors. In that case, just append this patch.

-- 
Trond Myklebust
Linux NFS client maintainer

NetApp
Trond.Myklebust@netapp.com
www.netapp.com
diff mbox

Patch

diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 2c8dd55..02e3303 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -926,8 +926,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);
@@ -2438,9 +2438,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;
@@ -3026,8 +3027,8 @@  static int _nfs4_proc_access(struct inode *inode, struct nfs_access_entry *entry
 #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;
 }
@@ -3105,7 +3106,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;
@@ -3298,8 +3302,8 @@  static int _nfs4_proc_rename(struct inode *old_dir, struct qstr *old_name,
 		nfs4_label_free(res.old_label);
 		nfs4_label_free(res.new_label);
 	}
-#endif
 out:
+#endif
 	return status;
 }
 
@@ -3418,7 +3422,9 @@  static struct nfs4_createdata *nfs4_alloc_createdata(struct inode *dir,
 		nfs_fattr_init(data->res.fattr);
 	}
 	return data;
+#ifdef CONFIG_NFS_V4_SECURITY_LABEL
 out_free:
+#endif
 	kfree(data);
 	return NULL;
 }
@@ -3474,11 +3480,11 @@  static int nfs4_proc_symlink(struct inode *dir, struct dentry *dentry,
 		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);
@@ -3522,7 +3528,10 @@  static int nfs4_proc_mkdir(struct inode *dir, struct dentry *dentry,
 		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
@@ -3640,9 +3649,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 --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h
index 2ef01f8..f4bb5c4 100644
--- a/include/linux/nfs_fs.h
+++ b/include/linux/nfs_fs.h
@@ -502,8 +502,8 @@  extern void nfs4_label_init(struct nfs4_label *);
 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
 
 /*