Akinobu Mita
a451751172
scsi_debug: fix do_device_access() with wrap around range
...
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: "David S. Miller" <davem@davemloft.net>
Cc: "James E.J. Bottomley" <JBottomley@parallels.com>
Cc: Douglas Gilbert <dgilbert@interlog.com>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: Horia Geanta <horia.geanta@freescale.com>
Cc: Imre Deak <imre.deak@intel.com>
Cc: Tejun Heo <tj@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2013-07-09 10:33:30 -07:00
..
2013-07-04 12:30:30 -07:00
2013-04-09 14:13:26 -04:00
2013-05-28 12:02:12 +02:00
2013-06-04 11:15:59 -07:00
2012-08-20 14:51:24 -07:00
2013-04-09 14:13:27 -04:00
2013-07-03 16:07:41 -07:00
2013-07-04 12:30:30 -07:00
2013-05-02 07:32:26 -07:00
2013-04-24 16:43:00 +02:00
2013-06-04 11:16:28 -07:00
2013-06-26 10:48:24 -07:00
2013-04-11 16:00:31 -07:00
2011-07-26 16:49:47 -07:00
2013-06-26 23:08:22 -07:00
2013-07-04 12:30:30 -07:00
2013-05-02 11:58:18 -07:00
2013-06-04 11:15:59 -07:00
2013-07-04 11:40:58 -07:00
2013-06-04 11:15:59 -07:00
2013-07-04 12:30:30 -07:00
2013-06-28 13:41:33 -07:00
2013-06-24 12:55:34 -07:00
2013-05-01 17:51:54 -07:00
2013-06-04 11:15:59 -07:00
2013-07-03 16:07:25 -07:00
2013-04-09 14:13:21 -04:00
2013-07-04 12:30:30 -07:00
2013-06-26 23:08:22 -07:00
2013-07-03 16:07:41 -07:00
2013-04-09 14:13:15 -04:00
2013-06-28 13:17:35 -07:00
2013-02-22 23:31:31 -05:00
2011-03-31 11:26:23 -03:00
2013-02-22 23:31:31 -05:00
2013-06-24 16:32:22 -07:00
2011-03-31 11:26:23 -03:00
2011-03-31 11:26:23 -03:00
2012-03-28 18:30:03 +01:00
2011-03-31 11:26:23 -03:00
2013-01-03 15:57:01 -08:00
2013-04-09 14:13:15 -04:00
2013-06-24 19:44:18 +02:00
2013-06-24 19:44:18 +02:00
2013-04-09 14:13:22 -04:00
2013-04-09 14:13:22 -04:00
2012-06-28 11:44:36 +02:00
2013-04-09 14:13:23 -04:00
2013-04-09 14:13:28 -04:00
2013-04-09 14:13:29 -04:00
2013-04-09 14:13:29 -04:00
2013-04-09 14:13:29 -04:00
2013-04-09 14:13:24 -04:00
2013-06-26 18:32:47 -07:00
2013-06-26 18:32:47 -07:00
2013-01-03 15:57:01 -08:00
2013-02-27 19:10:18 -08:00
2012-09-14 11:58:53 +01:00
2013-04-09 14:13:24 -04:00
2011-03-31 11:26:23 -03:00
2013-01-03 15:57:01 -08:00
2013-04-09 14:13:24 -04:00
2013-04-09 14:13:17 -04:00
2013-04-09 14:13:17 -04:00
2013-04-09 14:13:23 -04:00
2011-05-01 10:22:40 -05:00
2012-04-05 17:09:40 -07:00
2013-01-03 15:57:01 -08:00
2013-06-26 18:32:47 -07:00
2013-04-09 14:13:17 -04:00
2013-04-09 14:13:16 -04:00
2013-04-09 14:13:16 -04:00
2013-04-09 14:13:16 -04:00
2013-04-09 14:13:16 -04:00
2013-04-09 14:13:15 -04:00
2013-02-06 12:18:56 -08:00
2012-05-10 09:19:39 +01:00
2013-02-24 09:36:58 +00:00
2012-05-10 09:19:39 +01:00
2013-01-03 15:57:01 -08:00
2012-11-27 08:59:43 +04:00
2013-04-09 14:13:16 -04:00
2013-04-09 14:13:25 -04:00
2013-01-03 15:57:01 -08:00
2011-03-31 11:26:23 -03:00
2013-07-03 19:49:46 -07:00
2013-06-04 11:16:22 -07:00
2013-04-09 14:13:27 -04:00
2013-04-09 14:13:27 -04:00
2012-01-03 22:54:55 -05:00
2013-04-11 16:55:04 -07:00
2013-01-03 15:57:01 -08:00
2013-06-26 18:32:47 -07:00
2013-01-03 15:57:01 -08:00
2013-06-18 13:48:45 +02:00
2013-06-26 18:04:11 -07:00
2011-10-31 19:31:24 -04:00
2012-03-28 18:30:03 +01:00
2013-01-03 15:57:01 -08:00
2013-04-09 14:13:17 -04:00
2013-04-09 14:13:17 -04:00
2012-12-01 10:09:17 +00:00
2013-06-05 13:49:36 -06:00
2013-04-29 15:41:57 -04:00
2012-03-28 18:30:03 +01:00
2013-01-03 15:57:01 -08:00
2013-04-09 14:13:15 -04:00
2013-04-15 14:30:44 -06:00
2013-04-15 14:30:44 -06:00
2012-03-28 18:30:03 +01:00
2013-04-09 14:13:17 -04:00
2013-04-09 14:13:17 -04:00
2013-01-03 15:57:01 -08:00
2013-01-03 15:57:01 -08:00
2011-05-10 10:16:21 +02:00
2013-06-19 17:53:35 +02:00
2011-03-31 11:26:23 -03:00
2012-03-28 18:30:03 +01:00
2011-03-31 11:26:23 -03:00
2013-04-09 14:13:17 -04:00
2013-04-09 14:13:17 -04:00
2013-06-18 13:48:45 +02:00
2012-02-21 11:40:37 +01:00
2013-04-09 14:13:17 -04:00
2013-01-03 15:57:01 -08:00
2013-01-03 15:57:01 -08:00
2013-01-03 15:57:01 -08:00
2013-01-03 15:57:01 -08:00
2013-07-09 10:33:30 -07:00
2013-06-24 13:00:10 -07:00
2013-07-04 12:30:30 -07:00
2011-10-31 19:31:23 -04:00
2013-05-06 12:48:17 -07:00
2013-03-28 14:27:24 -04:00
2013-06-03 21:49:52 +02:00
2012-07-20 09:05:54 +01:00
2013-05-31 15:16:51 -04:00
2013-06-24 13:00:10 -07:00
2013-06-04 11:16:24 -07:00
2011-10-31 19:31:23 -04:00
2011-05-01 10:20:10 -05:00
2011-05-24 12:38:36 -04:00
2013-07-03 16:07:41 -07:00
2013-06-26 18:04:11 -07:00
2012-12-01 10:08:41 +00:00
2012-05-10 09:06:12 +01:00
2012-11-30 17:40:33 -08:00
2013-06-26 17:56:18 -07:00
2012-01-03 22:54:07 -05:00
2013-05-02 15:37:03 -07:00
2013-07-04 12:30:30 -07:00
2013-06-26 17:56:18 -07:00
2011-06-29 12:14:25 -05:00
2013-05-07 20:16:25 -07:00
2013-01-03 15:57:01 -08:00
2013-01-03 15:57:01 -08:00
2013-01-03 15:57:01 -08:00
2011-10-31 19:31:24 -04:00
2013-05-07 02:16:21 -04:00
2011-07-21 14:15:58 -07:00
2013-04-06 11:14:20 +01:00
2012-09-14 17:59:29 +01:00
2013-01-03 15:57:01 -08:00
2013-06-26 20:12:31 -07:00
2013-05-04 14:50:16 -04:00
2012-03-28 18:30:03 +01:00
2013-05-04 14:50:16 -04:00
2013-05-04 14:50:16 -04:00
2013-01-03 15:57:01 -08:00
2013-01-03 15:57:01 -08:00
2013-01-03 15:57:01 -08:00
2013-04-09 14:13:17 -04:00
2013-04-09 14:13:17 -04:00
2013-01-03 15:57:01 -08:00
2012-03-28 18:30:03 +01:00
2012-03-28 18:30:03 +01:00
2013-04-08 23:06:56 +09:30
2013-01-03 15:57:01 -08:00
2012-03-27 08:26:36 +01:00
2013-04-09 14:13:15 -04:00
2013-04-09 14:13:15 -04:00
2013-04-09 14:13:15 -04:00
2013-01-03 15:57:01 -08:00
2013-01-03 15:57:01 -08:00