dm: do not forward ioctls from logical volumes to the underlying device

commit ec8013beddd717d1740cfefb1a9b900deef85462 upstream.

A logical volume can map to just part of underlying physical volume.
In this case, it must be treated like a partition.

Based on a patch from Alasdair G Kergon.

Cc: Alasdair G Kergon <>
Signed-off-by: Paolo Bonzini <>
Signed-off-by: Linus Torvalds <>
[bwh: Backport to 2.6.32 - drop change to drivers/md/dm-flakey.c]
Signed-off-by: Ben Hutchings <>
Signed-off-by: Greg Kroah-Hartman <>

Signed-off-by: Willy Tarreau <>
2 files changed