All of lore.kernel.org
 help / color / mirror / Atom feed
From: "J. Bruce Fields" <bfields@fieldses.org>
To: Trond Myklebust <trond.myklebust@primarydata.com>
Cc: Anna Schumaker <Anna.Schumaker@Netapp.com>, linux-nfs@vger.kernel.org
Subject: Re: [PATCH] nfsd: Fix up the "supattr_exclcreat" attributes
Date: Tue, 9 May 2017 16:56:59 -0400	[thread overview]
Message-ID: <20170509205659.GC6289@fieldses.org> (raw)
In-Reply-To: <20170509202459.117361-1-trond.myklebust@primarydata.com>

On Tue, May 09, 2017 at 04:24:59PM -0400, Trond Myklebust wrote:
> If an NFSv4 client asks us for the supattr_exclcreat, then we must
> not return attributes that are unsupported by this minor version.

Thanks!  Applying with a stable cc.

--b.

> 
> Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
> Fixes: 75976de6556f ("NFSD: Return word2 bitmask if setting security..,")
> ---
>  fs/nfsd/nfs4xdr.c | 11 ++++++++---
>  1 file changed, 8 insertions(+), 3 deletions(-)
> 
> diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
> index 33017d652b1d..187498db0aa9 100644
> --- a/fs/nfsd/nfs4xdr.c
> +++ b/fs/nfsd/nfs4xdr.c
> @@ -2831,9 +2831,14 @@ nfsd4_encode_fattr(struct xdr_stream *xdr, struct svc_fh *fhp,
>  	}
>  #endif /* CONFIG_NFSD_PNFS */
>  	if (bmval2 & FATTR4_WORD2_SUPPATTR_EXCLCREAT) {
> -		status = nfsd4_encode_bitmap(xdr, NFSD_SUPPATTR_EXCLCREAT_WORD0,
> -						  NFSD_SUPPATTR_EXCLCREAT_WORD1,
> -						  NFSD_SUPPATTR_EXCLCREAT_WORD2);
> +		u32 supp[3];
> +
> +		memcpy(supp, nfsd_suppattrs[minorversion], sizeof(supp));
> +		supp[0] &= NFSD_SUPPATTR_EXCLCREAT_WORD0;
> +		supp[1] &= NFSD_SUPPATTR_EXCLCREAT_WORD1;
> +		supp[2] &= NFSD_SUPPATTR_EXCLCREAT_WORD2;
> +
> +		status = nfsd4_encode_bitmap(xdr, supp[0], supp[1], supp[2]);
>  		if (status)
>  			goto out;
>  	}
> -- 
> 2.9.3

  reply	other threads:[~2017-05-09 20:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-09 20:24 [PATCH] nfsd: Fix up the "supattr_exclcreat" attributes Trond Myklebust
2017-05-09 20:56 ` J. Bruce Fields [this message]
  -- strict thread matches above, loose matches on Subject: below --
2017-05-23 18:37 Patch "nfsd: Fix up the "supattr_exclcreat" attributes" has been added to the 4.4-stable tree gregkh
2017-05-23 19:23 ` Greg KH
2017-05-23 20:38   ` J. Bruce Fields
2017-05-23 21:44     ` [PATCH] nfsd: Fix up the "supattr_exclcreat" attributes J. Bruce Fields
2017-06-12  7:40       ` Greg KH

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=20170509205659.GC6289@fieldses.org \
    --to=bfields@fieldses.org \
    --cc=Anna.Schumaker@Netapp.com \
    --cc=linux-nfs@vger.kernel.org \
    --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 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.