]> www.infradead.org Git - users/hch/block.git/commit
blk-lib: check for kill signal in ioctl BLKDISCARD blk-discard-killable
authorChristoph Hellwig <hch@lst.de>
Fri, 3 May 2024 16:14:01 +0000 (18:14 +0200)
committerChristoph Hellwig <hch@lst.de>
Fri, 3 May 2024 16:52:27 +0000 (18:52 +0200)
commitfb0a0373c3e9e6ee70b6de3eaf4e0b52c771e53e
tree184e536f4bb7792b8a5dc44a65d804b595c73162
parent494804c099582f51ff6350558fd836a047b65898
blk-lib: check for kill signal in ioctl BLKDISCARD

Discards can access a significant capacity and take longer than the user
expected.  A user may change their mind about wanting to run that command
and attempt to kill the process and do something else with their device.
But since the task is uninterruptable, they have to wait for it to
finish, which could be many hours.

Open code blkdev_issue_discard in the BLKDISCARD ioctl handler and check
for a fatal signal at each iteration so the user doesn't have to wait
for their regretted operation to complete naturally.

Heavily based on an earlier patch from Keith Busch.

Reported-by: Conrad Meyer <conradmeyer@meta.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
block/ioctl.c