From: " J. Bruce Fields" <bfields@citi.umich.edu>
To: Benny Halevy <bhalevy@panasas.com>
Cc: linux-nfs@vger.kernel.org
Subject: Re: [PATCH] nfsd: nfs4callback encode_stateid helper function
Date: Tue, 1 Jun 2010 19:21:20 -0400 [thread overview]
Message-ID: <20100601232120.GF27423@fieldses.org> (raw)
In-Reply-To: <1274770223-28968-1-git-send-email-bhalevy@panasas.com>
Thanks.--b.
On Tue, May 25, 2010 at 09:50:23AM +0300, Benny Halevy wrote:
> To be used also for the pnfs cb_layoutrecall callback
>
> Signed-off-by: Benny Halevy <bhalevy@panasas.com>
> [nfsd4: fix cb_recall encoding]
> "nfsd: nfs4callback encode_stateid helper function" forgot to reserve
> more space after return from the new helper.
> Reported-by: Michael Groshans <groshans@citi.umich.edu>
> Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
> Signed-off-by: Benny Halevy <bhalevy@panasas.com>
> ---
> fs/nfsd/nfs4callback.c | 16 +++++++++++++---
> 1 files changed, 13 insertions(+), 3 deletions(-)
>
> diff --git a/fs/nfsd/nfs4callback.c b/fs/nfsd/nfs4callback.c
> index eb78e7e..6bacd0e 100644
> --- a/fs/nfsd/nfs4callback.c
> +++ b/fs/nfsd/nfs4callback.c
> @@ -205,6 +205,16 @@ nfs_cb_stat_to_errno(int stat)
> */
>
> static void
> +encode_stateid(struct xdr_stream *xdr, stateid_t *sid)
> +{
> + __be32 *p;
> +
> + RESERVE_SPACE(sizeof(stateid_t));
> + WRITE32(sid->si_generation);
> + WRITEMEM(&sid->si_opaque, sizeof(stateid_opaque_t));
> +}
> +
> +static void
> encode_cb_compound_hdr(struct xdr_stream *xdr, struct nfs4_cb_compound_hdr *hdr)
> {
> __be32 * p;
> @@ -229,10 +239,10 @@ encode_cb_recall(struct xdr_stream *xdr, struct nfs4_delegation *dp,
> __be32 *p;
> int len = dp->dl_fh.fh_size;
>
> - RESERVE_SPACE(12+sizeof(dp->dl_stateid) + len);
> + RESERVE_SPACE(4);
> WRITE32(OP_CB_RECALL);
> - WRITE32(dp->dl_stateid.si_generation);
> - WRITEMEM(&dp->dl_stateid.si_opaque, sizeof(stateid_opaque_t));
> + encode_stateid(xdr, &dp->dl_stateid);
> + RESERVE_SPACE(8 + (XDR_QUADLEN(len) << 2));
> WRITE32(0); /* truncate optimization not implemented */
> WRITE32(len);
> WRITEMEM(&dp->dl_fh.fh_base, len);
> --
> 1.6.6.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
prev parent reply other threads:[~2010-06-01 23:21 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-25 6:50 [PATCH] nfsd: nfs4callback encode_stateid helper function Benny Halevy
2010-06-01 23:21 ` J. Bruce Fields [this message]
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=20100601232120.GF27423@fieldses.org \
--to=bfields@citi.umich.edu \
--cc=bhalevy@panasas.com \
--cc=linux-nfs@vger.kernel.org \
/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).