• Milan Broz's avatar
    dm io: fix discard support · 0c535e0d
    Milan Broz authored
    This patch fixes a crash by recognising discards in dm_io.
    
    Currently dm_mirror can send REQ_DISCARD bios if running over a
    discard-enabled device and without support in dm_io the system
    crashes badly.
    
    BUG: unable to handle kernel paging request at 00800000
    IP:  __bio_add_page.part.17+0xf5/0x1e0
    ...
     bio_add_page+0x56/0x70
     dispatch_io+0x1cf/0x240 [dm_mod]
     ? km_get_page+0x50/0x50 [dm_mod]
     ? vm_next_page+0x20/0x20 [dm_mod]
     ? mirror_flush+0x130/0x130 [dm_mirror]
     dm_io+0xdc/0x2b0 [dm_mod]
    ...
    
    Introduced in 2.6.38-rc1 by commit 5fc2ffea
    (dm raid1: support discard).
    Signed-off-by: default avatarMilan Broz <mbroz@redhat.com>
    Cc: stable@kernel.org
    Acked-by: default avatarMike Snitzer <snitzer@redhat.com>
    Signed-off-by: default avatarAlasdair G Kergon <agk@redhat.com>
    0c535e0d
dm-io.c 12.5 KB