[PATCH 4/6] fs: Don't call dio_cleanup() before submitting all bios

From: Jan Kara
Date: Thu Jan 31 2013 - 16:50:48 EST


do_blockdev_direct_IO() can call dio_cleanup() before submitting
all bios. This will be inconvenient for us because we need to keep
preallocated structure in sdio which we attach to bio on submit and
it is natural to cleanup unused allocation in dio_cleanup().

Since dio_cleanup() is called again after submitting the last bio it is
enough to just remove the first dio_cleanup() call.

Signed-off-by: Jan Kara <jack@xxxxxxx>
---
fs/direct-io.c | 4 +---
1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/fs/direct-io.c b/fs/direct-io.c
index cf5b44b..3a430f3 100644
--- a/fs/direct-io.c
+++ b/fs/direct-io.c
@@ -1209,10 +1209,8 @@ do_blockdev_direct_IO(int rw, struct kiocb *iocb, struct inode *inode,
((sdio.final_block_in_request - sdio.block_in_file) <<
blkbits);

- if (retval) {
- dio_cleanup(dio, &sdio);
+ if (retval)
break;
- }
} /* end iovec loop */

if (retval == -ENOTBLK) {
--
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/