Skip to content
Snippets Groups Projects
  1. Sep 07, 2022
  2. Sep 06, 2022
  3. Sep 05, 2022
    • Luo Meng's avatar
      dm-thin: Resume failed in FAIL mode · b3ed949d
      Luo Meng authored
      hulk inclusion
      category: bugfix
      bugzilla: https://gitee.com/openeuler/kernel/issues/I5P05D
      
      
      CVE: NA
      
      --------------------------------
      
      When thinpool is suspended and sets fail_io, resume will report error
      as below:
      device-mapper: resume ioctl on vg-thinpool  failed: Invalid argument
      
      Thinpool also can't be removed if bio is in deferred list.
      
      This can be easily reproduced using:
      
        echo "offline" > /sys/block/sda/device/state
        dd if=/dev/zero of=/dev/mapper/thin bs=4K count=1
        dmsetup suspend /dev/mapper/pool
        mkfs.ext4 /dev/mapper/thin
        dmsetup resume /dev/mapper/pool
      
      The root cause is maybe_resize_data_dev() will check fail_io and return
      error before called dm_resume.
      
      Fix this by adding FAIL mode check at the end of  pool_preresume().
      
      Fixes: da105ed5 (dm thin metadata: introduce dm_pool_abort_metadata)
      Signed-off-by: default avatarLuo Meng <luomeng12@huawei.com>
      Reviewed-by: default avatarHou Tao <houtao1@huawei.com>
      Signed-off-by: default avatarYongqiang Liu <liuyongqiang13@huawei.com>