X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?p=pandora-kernel.git;a=blobdiff_plain;f=block%2Fblk-lib.c;h=36751e211bb822f8852c4c50b305563f1d8b329e;hp=2b461b496a788c11d00616efaf16df121e620160;hb=refs%2Fheads%2Fpandora-3.2-.57-wip;hpb=e10b87d2b5b4574cdf3a5a19b22ca88b91ba7151 diff --git a/block/blk-lib.c b/block/blk-lib.c index 2b461b496a78..36751e211bb8 100644 --- a/block/blk-lib.c +++ b/block/blk-lib.c @@ -101,6 +101,14 @@ int blkdev_issue_discard(struct block_device *bdev, sector_t sector, atomic_inc(&bb.done); submit_bio(type, bio); + + /* + * We can loop for a long time in here, if someone does + * full device discards (like mkfs). Be nice and allow + * us to schedule out to avoid softlocking if preempt + * is disabled. + */ + cond_resched(); } /* Wait for bios in-flight */