All of lore.kernel.org
 help / color / mirror / Atom feed
From: Josh Durgin <josh.durgin@inktank.com>
To: Alex Elder <elder@inktank.com>
Cc: ceph-devel@vger.kernel.org
Subject: Re: [PATCH] libceph: don't clear bio_iter in prepare_write_message()
Date: Mon, 11 Mar 2013 12:07:47 -0700	[thread overview]
Message-ID: <513E2B83.3070509@inktank.com> (raw)
In-Reply-To: <513B6520.8050303@inktank.com>

Reviewed-by: Josh Durgin <josh.durgin@inktank.com>

On 03/09/2013 08:36 AM, Alex Elder wrote:
> This patch is available in the branch "review/wip-msgr-refactor"
> (prior to 6 other patches) in the ceph-client git repository.
> That branch is based on branch "review/wip-abstract-2".
>
> 					-Alex
>
> At one time it was necessary to clear a message's bio_iter field to
> avoid a bad pointer dereference in write_partial_msg_pages().
>
> That no longer seems to be the case.  Here's why.
>
> The message's bio fields represent (in this case) outgoing data.
> Between where the bio_iter is made NULL in prepare_write_message()
> and the call in that function to prepare_message_data(), the
> bio fields are never used.
>
> In prepare_message_data(), init-bio_iter() is called, and the result
> of that overwrites the value in the message's bio_iter field.
>
> Because it gets overwritten anyway, there is no need to set it to
> NULL.  So don't do it.
>
> This resolves:
>      http://tracker.ceph.com/issues/4402
>
> Signed-off-by: Alex Elder <elder@inktank.com>
> ---
>   net/ceph/messenger.c |    4 ----
>   1 file changed, 4 deletions(-)
>
> diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c
> index e75a03d..17d9321 100644
> --- a/net/ceph/messenger.c
> +++ b/net/ceph/messenger.c
> @@ -804,10 +804,6 @@ static void prepare_write_message(struct
> ceph_connection *con)
>   		m->hdr.seq = cpu_to_le64(++con->out_seq);
>   		m->needs_out_seq = false;
>   	}
> -#ifdef CONFIG_BLOCK
> -	else
> -		m->bio_iter = NULL;
> -#endif
>
>   	dout("prepare_write_message %p seq %lld type %d len %d+%d+%d (%zd)\n",
>   	     m, con->out_seq, le16_to_cpu(m->hdr.type),
>


      reply	other threads:[~2013-03-11 19:08 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-09 16:36 [PATCH] libceph: don't clear bio_iter in prepare_write_message() Alex Elder
2013-03-11 19:07 ` Josh Durgin [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=513E2B83.3070509@inktank.com \
    --to=josh.durgin@inktank.com \
    --cc=ceph-devel@vger.kernel.org \
    --cc=elder@inktank.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.