All of lore.kernel.org
 help / color / mirror / Atom feed
From: Douglas Gilbert <dgilbert@interlog.com>
To: Akinobu Mita <akinobu.mita@gmail.com>
Cc: linux-kernel@vger.kernel.org, akpm@linux-foundation.org,
	"James E.J. Bottomley" <JBottomley@parallels.com>,
	linux-scsi@vger.kernel.org
Subject: Re: [PATCH v3 4/4] scsi_debug: fix do_device_access() with wrap around range
Date: Tue, 25 Jun 2013 01:34:46 +0200	[thread overview]
Message-ID: <51C8D796.8000005@interlog.com> (raw)
In-Reply-To: <1371991061-19437-5-git-send-email-akinobu.mita@gmail.com>

On 13-06-23 02:37 PM, Akinobu Mita wrote:
> do_device_access() is a function that abstracts copying SG list from/to
> ramdisk storage (fake_storep).
>
> It must deal with the ranges exceeding actual fake_storep size, because
> such ranges are valid if virtual_gb is set greater than zero, and they
> should be treated as fake_storep is repeatedly mirrored up to virtual size.
>
> Unfortunately, it can't deal with the range which wraps around the end of
> fake_storep. A wrap around range is copied by two sg_copy_{from,to}_buffer()
> calls, but sg_copy_{from,to}_buffer() can't copy from/to in the middle of
> SG list, therefore the second call can't copy correctly.
>
> This fixes it by using sg_pcopy_{from,to}_buffer() that can copy from/to
> the middle of SG list.
>
> This also simplifies the assignment of sdb->resid in fill_from_dev_buffer().
> Because fill_from_dev_buffer() is now only called once per command
> execution cycle.  So it is not necessary to take care to decrease
> sdb->resid if fill_from_dev_buffer() is called more than once.
>
> Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
> Cc: "James E.J. Bottomley" <JBottomley@parallels.com>
> Cc: Douglas Gilbert <dgilbert@interlog.com>
> Cc: linux-scsi@vger.kernel.org
> ---
>
> * No change from v2

Acked-by: Douglas Gilbert <dgilbert@interlog.com>

      reply	other threads:[~2013-06-24 23:34 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-23 12:37 [PATCH v3 0/4] introduce sg_pcopy_from_buffer() and sg_pcopy_to_buffer() Akinobu Mita
2013-06-23 12:37 ` Akinobu Mita
2013-06-23 12:37 ` [PATCH v3 1/4] lib/scatterlist: factor out sg_miter_get_next_page() from sg_miter_next() Akinobu Mita
2013-06-23 12:37   ` Akinobu Mita
2013-06-23 12:37 ` [PATCH v3 2/4] lib/scatterlist: introduce sg_pcopy_from_buffer() and sg_pcopy_to_buffer() Akinobu Mita
2013-06-23 12:37   ` Akinobu Mita
2013-06-24 23:27   ` Tejun Heo
2013-06-24 23:27     ` Tejun Heo
2013-06-23 12:37 ` [PATCH v3 3/4] crypto: talitos: use sg_pcopy_to_buffer() Akinobu Mita
2013-06-23 12:37   ` Akinobu Mita
2013-06-23 12:37 ` [PATCH v3 4/4] scsi_debug: fix do_device_access() with wrap around range Akinobu Mita
2013-06-24 23:34   ` Douglas Gilbert [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=51C8D796.8000005@interlog.com \
    --to=dgilbert@interlog.com \
    --cc=JBottomley@parallels.com \
    --cc=akinobu.mita@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@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 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.