X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=block%2Fblk-lib.c;h=36751e211bb822f8852c4c50b305563f1d8b329e;hb=2cd0304f853161b664bbf2f2f20d4e395b438bec;hp=2b461b496a788c11d00616efaf16df121e620160;hpb=89c63a8ef36a621cb6790c1a56c737e6805ad8f4;p=pandora-kernel.git 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 */