@@ -2259,7 +2259,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);
@@ -1399,7 +1399,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);
@@ -1419,8 +1418,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);
}
}