* [PATCH] nfsd: Remove duplicate macro define for max sec label length
@ 2015-03-28 15:46 Kinglong Mee
2015-03-31 20:47 ` J. Bruce Fields
0 siblings, 1 reply; 2+ messages in thread
From: Kinglong Mee @ 2015-03-28 15:46 UTC (permalink / raw)
To: J. Bruce Fields; +Cc: Linux NFS Mailing List, kinglongmee
NFS4_MAXLABELLEN has defined for sec label max length, use it directly.
Signed-off-by: Kinglong Mee <kinglongmee@gmail.com>
---
fs/nfsd/nfs4proc.c | 2 +-
fs/nfsd/nfs4xdr.c | 2 +-
fs/nfsd/xdr4.h | 1 -
3 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c
index d30bea8..6bd4391 100644
--- a/fs/nfsd/nfs4proc.c
+++ b/fs/nfsd/nfs4proc.c
@@ -1815,7 +1815,7 @@ static inline u32 nfsd4_getattr_rsize(struct svc_rqst *rqstp,
bmap0 &= ~FATTR4_WORD0_FILEHANDLE;
}
if (bmap2 & FATTR4_WORD2_SECURITY_LABEL) {
- ret += NFSD4_MAX_SEC_LABEL_LEN + 12;
+ ret += NFS4_MAXLABELLEN + 12;
bmap2 &= ~FATTR4_WORD2_SECURITY_LABEL;
}
/*
diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
index df5e66c..eff0a94 100644
--- a/fs/nfsd/nfs4xdr.c
+++ b/fs/nfsd/nfs4xdr.c
@@ -424,7 +424,7 @@ nfsd4_decode_fattr(struct nfsd4_compoundargs *argp, u32 *bmval,
len += 4;
dummy32 = be32_to_cpup(p++);
READ_BUF(dummy32);
- if (dummy32 > NFSD4_MAX_SEC_LABEL_LEN)
+ if (dummy32 > NFS4_MAXLABELLEN)
return nfserr_badlabel;
len += (XDR_QUADLEN(dummy32) << 2);
READMEM(buf, dummy32);
diff --git a/fs/nfsd/xdr4.h b/fs/nfsd/xdr4.h
index 0bda93e..8bae5d8 100644
--- a/fs/nfsd/xdr4.h
+++ b/fs/nfsd/xdr4.h
@@ -40,7 +40,6 @@
#include "state.h"
#include "nfsd.h"
-#define NFSD4_MAX_SEC_LABEL_LEN 2048
#define NFSD4_MAX_TAGLEN 128
#define XDR_LEN(n) (((n) + 3) & ~3)
--
2.3.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] nfsd: Remove duplicate macro define for max sec label length
2015-03-28 15:46 [PATCH] nfsd: Remove duplicate macro define for max sec label length Kinglong Mee
@ 2015-03-31 20:47 ` J. Bruce Fields
0 siblings, 0 replies; 2+ messages in thread
From: J. Bruce Fields @ 2015-03-31 20:47 UTC (permalink / raw)
To: Kinglong Mee; +Cc: Linux NFS Mailing List
On Sat, Mar 28, 2015 at 11:46:09PM +0800, Kinglong Mee wrote:
> NFS4_MAXLABELLEN has defined for sec label max length, use it directly.
Thanks, applying for 4.1--b.
>
> Signed-off-by: Kinglong Mee <kinglongmee@gmail.com>
> ---
> fs/nfsd/nfs4proc.c | 2 +-
> fs/nfsd/nfs4xdr.c | 2 +-
> fs/nfsd/xdr4.h | 1 -
> 3 files changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c
> index d30bea8..6bd4391 100644
> --- a/fs/nfsd/nfs4proc.c
> +++ b/fs/nfsd/nfs4proc.c
> @@ -1815,7 +1815,7 @@ static inline u32 nfsd4_getattr_rsize(struct svc_rqst *rqstp,
> bmap0 &= ~FATTR4_WORD0_FILEHANDLE;
> }
> if (bmap2 & FATTR4_WORD2_SECURITY_LABEL) {
> - ret += NFSD4_MAX_SEC_LABEL_LEN + 12;
> + ret += NFS4_MAXLABELLEN + 12;
> bmap2 &= ~FATTR4_WORD2_SECURITY_LABEL;
> }
> /*
> diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
> index df5e66c..eff0a94 100644
> --- a/fs/nfsd/nfs4xdr.c
> +++ b/fs/nfsd/nfs4xdr.c
> @@ -424,7 +424,7 @@ nfsd4_decode_fattr(struct nfsd4_compoundargs *argp, u32 *bmval,
> len += 4;
> dummy32 = be32_to_cpup(p++);
> READ_BUF(dummy32);
> - if (dummy32 > NFSD4_MAX_SEC_LABEL_LEN)
> + if (dummy32 > NFS4_MAXLABELLEN)
> return nfserr_badlabel;
> len += (XDR_QUADLEN(dummy32) << 2);
> READMEM(buf, dummy32);
> diff --git a/fs/nfsd/xdr4.h b/fs/nfsd/xdr4.h
> index 0bda93e..8bae5d8 100644
> --- a/fs/nfsd/xdr4.h
> +++ b/fs/nfsd/xdr4.h
> @@ -40,7 +40,6 @@
> #include "state.h"
> #include "nfsd.h"
>
> -#define NFSD4_MAX_SEC_LABEL_LEN 2048
> #define NFSD4_MAX_TAGLEN 128
> #define XDR_LEN(n) (((n) + 3) & ~3)
>
> --
> 2.3.4
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-03-31 20:47 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-28 15:46 [PATCH] nfsd: Remove duplicate macro define for max sec label length Kinglong Mee
2015-03-31 20:47 ` J. Bruce Fields
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).