All of lore.kernel.org
 help / color / mirror / Atom feed
* Error target causes entire device to error
@ 2008-11-10 22:16 Phillip Susi
  2008-11-13 18:38 ` Milan Broz
  0 siblings, 1 reply; 3+ messages in thread
From: Phillip Susi @ 2008-11-10 22:16 UTC (permalink / raw)
  To: device-mapper development

$ sudo dmsetup create foo
0 1 zero
1 1 error
$ sudo dd if=/dev/mapper/foo bs=512 count=1
dd: reading `/dev/mapper/foo': Input/output error
0+0 records in
0+0 records out
0 bytes (0 B) copied, 0.000715356 seconds, 0.0 kB/s

Why can't you read the first sector mapped to the zero target without 
getting an error?  It doesn't seem to matter where the error target is 
in the table, or how big the virtual device is; any attempt to read 
anywhere returns an error if there are any sectors mapped to the error 
target.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Error target causes entire device to error
  2008-11-10 22:16 Error target causes entire device to error Phillip Susi
@ 2008-11-13 18:38 ` Milan Broz
  2008-11-13 19:43   ` Phillip Susi
  0 siblings, 1 reply; 3+ messages in thread
From: Milan Broz @ 2008-11-13 18:38 UTC (permalink / raw)
  To: device-mapper development


Phillip Susi wrote:
> $ sudo dmsetup create foo
> 0 1 zero
> 1 1 error
> $ sudo dd if=/dev/mapper/foo bs=512 count=1
> dd: reading `/dev/mapper/foo': Input/output error
> 0+0 records in
> 0+0 records out
> 0 bytes (0 B) copied, 0.000715356 seconds, 0.0 kB/s
> 
> Why can't you read the first sector mapped to the zero target without 
> getting an error?  It doesn't seem to matter where the error target is 
> in the table, or how big the virtual device is; any attempt to read 
> anywhere returns an error if there are any sectors mapped to the error 
> target.

try

dd iflag=direct if=/dev/mapper/foo bs=512 count=1
and
dd iflag=direct if=/dev/mapper/foo bs=512 count=1 skip=1

it seems that someone optimize the request, direct io does what you want.
in fact, dm receives bio requesting 1024 bytes, not 512.
(optimizing it to page size, but here it is limited by device size).

assuming that your arch has 4kb pages, try to setup device with
0 8 zero
8 8 error

and try again...

Milan
--
mbroz@redhat.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Error target causes entire device to error
  2008-11-13 18:38 ` Milan Broz
@ 2008-11-13 19:43   ` Phillip Susi
  0 siblings, 0 replies; 3+ messages in thread
From: Phillip Susi @ 2008-11-13 19:43 UTC (permalink / raw)
  To: device-mapper development

Milan Broz wrote:
> it seems that someone optimize the request, direct io does what you want.
> in fact, dm receives bio requesting 1024 bytes, not 512.
> (optimizing it to page size, but here it is limited by device size).
> 
> assuming that your arch has 4kb pages, try to setup device with
> 0 8 zero
> 8 8 error

Ahh, of course!  The buffer cache is trying to read a whole page.  And I 
guess it just gives up and fails the entire request rather than retrying 
only on the requested area.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-11-13 19:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-10 22:16 Error target causes entire device to error Phillip Susi
2008-11-13 18:38 ` Milan Broz
2008-11-13 19:43   ` Phillip Susi

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.