All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alex Elder <elder@ieee.org>
To: "Yan, Zheng" <zheng.z.yan@intel.com>, ceph-devel@vger.kernel.org
Subject: Re: [PATCH] libceph: fix oops in ceph_msg_data_pagelist_advance()
Date: Sat, 22 Mar 2014 18:10:30 -0500	[thread overview]
Message-ID: <532E1866.4070402@ieee.org> (raw)
In-Reply-To: <1395528897-26031-1-git-send-email-zheng.z.yan@intel.com>

On 03/22/2014 05:54 PM, Yan, Zheng wrote:
> When there is no more data, ceph_msg_data_pagelist_advance() should
> not move on to the next page.

Without looking very hard at this, this looks right.
Does ceph_msg_data_pages_advance() need the same fix?
And ceph_msg_data_bio_advance()?

I'm going to spend a little more time to refresh my
memory on these things.

					-Alex

> Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
> ---
>  net/ceph/messenger.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c
> index 30efc5c..8859f2e 100644
> --- a/net/ceph/messenger.c
> +++ b/net/ceph/messenger.c
> @@ -1004,6 +1004,9 @@ static bool ceph_msg_data_pagelist_advance(struct ceph_msg_data_cursor *cursor,
>  	if (!bytes || cursor->offset & ~PAGE_MASK)
>  		return false;	/* more bytes to process in the current page */
>  
> +	if (!cursor->resid)
> +		return false;   /* no more data */
> +
>  	/* Move on to the next page */
>  
>  	BUG_ON(list_is_last(&cursor->page->lru, &pagelist->head));
> 


  reply	other threads:[~2014-03-22 23:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-22 22:54 [PATCH] libceph: fix oops in ceph_msg_data_pagelist_advance() Yan, Zheng
2014-03-22 23:10 ` Alex Elder [this message]
2014-03-22 23:38   ` Yan, Zheng

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=532E1866.4070402@ieee.org \
    --to=elder@ieee.org \
    --cc=ceph-devel@vger.kernel.org \
    --cc=zheng.z.yan@intel.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.