aboutsummaryrefslogtreecommitdiffstats
path: root/block/blk-exec.c
diff options
context:
space:
mode:
authorJens Axboe <jaxboe@fusionio.com>2010-11-16 10:09:42 +0100
committerJens Axboe <jaxboe@fusionio.com>2010-11-16 10:09:42 +0100
commita02056349cdea2252cd2b21643ebf025e83a29f2 (patch)
treeb7c889d6cbe8e7188d07d99a5c9da858c53a5b6c /block/blk-exec.c
parent34db1d595ef6f183fbc1e42cda45a3dfa0035258 (diff)
parente53beacd23d9cb47590da6a7a7f6d417b941a994 (diff)
downloadkernel_samsung_smdk4412-a02056349cdea2252cd2b21643ebf025e83a29f2.zip
kernel_samsung_smdk4412-a02056349cdea2252cd2b21643ebf025e83a29f2.tar.gz
kernel_samsung_smdk4412-a02056349cdea2252cd2b21643ebf025e83a29f2.tar.bz2
Merge branch 'v2.6.37-rc2' into for-2.6.38/core
Diffstat (limited to 'block/blk-exec.c')
-rw-r--r--block/blk-exec.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/block/blk-exec.c b/block/blk-exec.c
index e1672f1..cf1456a 100644
--- a/block/blk-exec.c
+++ b/block/blk-exec.c
@@ -80,6 +80,7 @@ int blk_execute_rq(struct request_queue *q, struct gendisk *bd_disk,
DECLARE_COMPLETION_ONSTACK(wait);
char sense[SCSI_SENSE_BUFFERSIZE];
int err = 0;
+ unsigned long hang_check;
/*
* we need an extra reference to the request, so we can look at
@@ -95,7 +96,13 @@ int blk_execute_rq(struct request_queue *q, struct gendisk *bd_disk,
rq->end_io_data = &wait;
blk_execute_rq_nowait(q, bd_disk, rq, at_head, blk_end_sync_rq);
- wait_for_completion(&wait);
+
+ /* Prevent hang_check timer from firing at us during very long I/O */
+ hang_check = sysctl_hung_task_timeout_secs;
+ if (hang_check)
+ while (!wait_for_completion_timeout(&wait, hang_check * (HZ/2)));
+ else
+ wait_for_completion(&wait);
if (rq->errors)
err = -EIO;