shutdown: close DM block device before issuing DM_DEV_REMOVE ioctl
authorYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 22 Nov 2024 20:47:40 +0000 (05:47 +0900)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 29 Nov 2024 13:26:56 +0000 (14:26 +0100)
commitb30364a0378881c6f0d0ff3124f56f4da989d91c
tree044169af2e6c1cd55f7f5023a0771df9767a586a
parenteb841e9b8eb5ec47c46617b288135b2119694ea0
shutdown: close DM block device before issuing DM_DEV_REMOVE ioctl

Otherwise, the ioctl() may fail with EBUSY.

Follow-up for b4b66b26620bfaf5818c95d5cffafd85207694e7.
Hopefully fixes #35243.

(cherry picked from commit b76730f3fe0e824db001b38c8ea848302be786ee)
src/shutdown/detach-dm.c