diff options
-rw-r--r-- | fs/direct-io.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/fs/direct-io.c b/fs/direct-io.c index b57b671e1106..b296942ff7d5 100644 --- a/fs/direct-io.c +++ b/fs/direct-io.c | |||
@@ -404,7 +404,6 @@ static struct bio *dio_await_one(struct dio *dio) | |||
404 | if (dio->bio_list == NULL) { | 404 | if (dio->bio_list == NULL) { |
405 | dio->waiter = current; | 405 | dio->waiter = current; |
406 | spin_unlock_irqrestore(&dio->bio_lock, flags); | 406 | spin_unlock_irqrestore(&dio->bio_lock, flags); |
407 | blk_run_address_space(dio->inode->i_mapping); | ||
408 | io_schedule(); | 407 | io_schedule(); |
409 | spin_lock_irqsave(&dio->bio_lock, flags); | 408 | spin_lock_irqsave(&dio->bio_lock, flags); |
410 | dio->waiter = NULL; | 409 | dio->waiter = NULL; |
@@ -450,9 +449,6 @@ static int dio_bio_complete(struct dio *dio, struct bio *bio) | |||
450 | */ | 449 | */ |
451 | static void dio_await_completion(struct dio *dio) | 450 | static void dio_await_completion(struct dio *dio) |
452 | { | 451 | { |
453 | if (dio->bio) | ||
454 | dio_bio_submit(dio); | ||
455 | |||
456 | /* | 452 | /* |
457 | * The bio_lock is not held for the read of bio_count. | 453 | * The bio_lock is not held for the read of bio_count. |
458 | * This is ok since it is the dio_bio_complete() that changes | 454 | * This is ok since it is the dio_bio_complete() that changes |
@@ -1085,6 +1081,9 @@ direct_io_worker(int rw, struct kiocb *iocb, struct inode *inode, | |||
1085 | if (dio->bio) | 1081 | if (dio->bio) |
1086 | dio_bio_submit(dio); | 1082 | dio_bio_submit(dio); |
1087 | 1083 | ||
1084 | /* All IO is now issued, send it on its way */ | ||
1085 | blk_run_address_space(inode->i_mapping); | ||
1086 | |||
1088 | /* | 1087 | /* |
1089 | * It is possible that, we return short IO due to end of file. | 1088 | * It is possible that, we return short IO due to end of file. |
1090 | * In that case, we need to release all the pages we got hold on. | 1089 | * In that case, we need to release all the pages we got hold on. |
@@ -1113,7 +1112,6 @@ direct_io_worker(int rw, struct kiocb *iocb, struct inode *inode, | |||
1113 | if (ret == 0) | 1112 | if (ret == 0) |
1114 | ret = dio->result; | 1113 | ret = dio->result; |
1115 | finished_one_bio(dio); /* This can free the dio */ | 1114 | finished_one_bio(dio); /* This can free the dio */ |
1116 | blk_run_address_space(inode->i_mapping); | ||
1117 | if (should_wait) { | 1115 | if (should_wait) { |
1118 | unsigned long flags; | 1116 | unsigned long flags; |
1119 | /* | 1117 | /* |