[PATCH] block: Make blkdev_issue_discard() interruptible

Lukas Czerner
2010-10-21T15:54:57Z

block/blk-lib.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/block/blk-lib.c b/block/blk-lib.c
index 1a320d2..db44671 100644
--- a/block/blk-lib.c
+++ b/block/blk-lib.c
@@ -91,6 +91,9 @@ int blkdev_issue_discard(struct block_device *bdev, sector_t sector,
bio_get(bio);
submit_bio(type, bio);

+ if (unlikely(fatal_signal_pending(current)))
+ ret = -ERESTARTSYS;
+
wait_for_completion(&wait);

if (bio_flagged(bio, BIO_EOPNOTSUPP))
--
1.7.2.3