All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 4/5] NFS: Send attributes in OPEN request for NFS4_CREATE_EXCLUSIVE4_1
@ 2015-07-28 11:13 Kinglong Mee
  2015-07-28 12:47 ` Trond Myklebust
  0 siblings, 1 reply; 3+ messages in thread
From: Kinglong Mee @ 2015-07-28 11:13 UTC (permalink / raw)
  To: Trond Myklebust, linux-nfs@vger.kernel.org; +Cc: kinglongmee

Client sends a SETATTR request after OPEN for updating attributes.
For create file with S_ISGID is set, the SETATTR will be not set S_ISGID
as chmod of no PERMISSION.

Signed-off-by: Kinglong Mee <kinglongmee@gmail.com>
---
 fs/nfs/nfs4proc.c | 2 +-
 fs/nfs/nfs4xdr.c  | 4 +---
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 8bee934..801f5f4 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -2413,7 +2413,7 @@ static int _nfs4_do_open(struct inode *dir,
 	state = ctx->state;
 
 	if ((opendata->o_arg.open_flags & O_EXCL) &&
-	    (opendata->o_arg.createmode != NFS4_CREATE_GUARDED)) {
+	    (opendata->o_arg.createmode == NFS4_CREATE_EXCLUSIVE)) {
 		nfs4_exclusive_attrset(opendata, sattr);
 
 		nfs_fattr_init(opendata->o_res.f_attr);
diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c
index 558cd65d..b5147bc 100644
--- a/fs/nfs/nfs4xdr.c
+++ b/fs/nfs/nfs4xdr.c
@@ -1382,7 +1382,6 @@ static inline void encode_openhdr(struct xdr_stream *xdr, const struct nfs_opena
 
 static inline void encode_createmode(struct xdr_stream *xdr, const struct nfs_openargs *arg)
 {
-	struct iattr dummy;
 	__be32 *p;
 
 	p = reserve_space(xdr, 4);
@@ -1402,8 +1401,7 @@ static inline void encode_createmode(struct xdr_stream *xdr, const struct nfs_op
 	case NFS4_CREATE_EXCLUSIVE4_1:
 		*p = cpu_to_be32(NFS4_CREATE_EXCLUSIVE4_1);
 		encode_nfs4_verifier(xdr, &arg->u.verifier);
-		dummy.ia_valid = 0;
-		encode_attrs(xdr, &dummy, arg->label, arg->server);
+		encode_attrs(xdr, arg->u.attrs, arg->label, arg->server);
 	}
 }
 
-- 
2.4.3


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-07-30  8:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-28 11:13 [PATCH 4/5] NFS: Send attributes in OPEN request for NFS4_CREATE_EXCLUSIVE4_1 Kinglong Mee
2015-07-28 12:47 ` Trond Myklebust
2015-07-30  8:57   ` Kinglong Mee

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.