linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kinglong Mee <kinglongmee@gmail.com>
To: "J. Bruce Fields" <bfields@fieldses.org>
Cc: "linux-nfs@vger.kernel.org" <linux-nfs@vger.kernel.org>,
	tigran.mkrtchyan@desy.de, kinglongmee@gmail.com,
	Trond Myklebust <trond.myklebust@primarydata.com>
Subject: [PATCH] NFSD: Encode security label as an array
Date: Thu, 30 Jul 2015 22:22:20 +0800	[thread overview]
Message-ID: <55BA331C.200@gmail.com> (raw)
In-Reply-To: <55BA130C.1050604@gmail.com>

According at,
https://tools.ietf.org/html/draft-ietf-nfsv4-minorversion2-38#section-12.2.4

"The FATTR4_SEC_LABEL contains an array of two components with the
 first component being an LFS."

Only supports one security label now.

Signed-off-by: Kinglong Mee <kinglongmee@gmail.com>
---
 fs/nfsd/nfs4xdr.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
index 5463385..fac05f9 100644
--- a/fs/nfsd/nfs4xdr.c
+++ b/fs/nfsd/nfs4xdr.c
@@ -2151,10 +2151,11 @@ nfsd4_encode_security_label(struct xdr_stream *xdr, struct svc_rqst *rqstp,
 {
 	__be32 *p;
 
-	p = xdr_reserve_space(xdr, len + 4 + 4 + 4);
+	p = xdr_reserve_space(xdr, len + 16);
 	if (!p)
 		return nfserr_resource;
 
+	*p++ = cpu_to_be32(1); /* Supports only one security label now */
 	/*
 	 * For now we use a 0 here to indicate the null translation; in
 	 * the future we may place a call to translation code here.
-- 
2.4.3


  parent reply	other threads:[~2015-07-30 14:22 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-28 11:46 [PATCH 3/4] 4.1 xdrdef: Fix bad define of sec_label4 Kinglong Mee
2015-07-29 19:37 ` J. Bruce Fields
2015-07-30 12:05   ` Kinglong Mee
2015-07-30 12:13     ` [PATCH v2] 4.1 xdrdef: Update nfs4.x to the latest dot-x-38.txt Kinglong Mee
2015-08-18 19:27       ` J. Bruce Fields
2015-07-30 14:22     ` Kinglong Mee [this message]
2015-07-30 14:22     ` [PATCH] NFS: Decode security label as an array Kinglong Mee
2015-07-30 15:48     ` [PATCH 3/4] 4.1 xdrdef: Fix bad define of sec_label4 J. Bruce Fields

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=55BA331C.200@gmail.com \
    --to=kinglongmee@gmail.com \
    --cc=bfields@fieldses.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=tigran.mkrtchyan@desy.de \
    --cc=trond.myklebust@primarydata.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).