[RESEND PATCHSET] direct-io: unify asyn/sync completion paths and fix completion bugs

[RESEND PATCHSET] direct-io: unify asyn/sync completion paths and fix completion bugs

Post by Tejun He » Fri, 10 Nov 2006 10:20:07


[forgot to include lkml, resending. sorry ppl.]

Hello, Zach Brown, all.

Chul-Woong Yang of Aratech reported kernel oops after failed aio
(partially mapped request) on 2.6.19-rc4 and I spent three days
chasing the bug and hacking direct-io only to find out that there are
pending patches in -mm.

Oh, well.. As my patches are almost ready now, I'm posting it, for
cross-check if nothing else. The biggest difference between your fix
and mine is that instead of merging waiting code, I just unified whole
completion paths. ie. Sync requests are handled exactly the same as
async requests. They are pre-dirtied, completed from bio completion
callback and redirtied from bio_dirty_work if necessary. That
simplified the code a lot and made it humanly readable. :-)

The only concern is possible performance impact for sync DIOs due to
the change in how dirtying is done. As it's done per-bio, the chance
of being written back between pre-issue dirtying and post-completion
checking should be pretty slim, so I don't think it would have any
noticeable effect. Async DIOs have been handled that way after all.

I reshuffled things a bit just before finding out your patch and
didn't test it thoroughly after that, but it should be enough to get
the idea.

Arghh... The lesson here is... check -mm before starting hacking
unfamiliar code. I'm back to libata now.

Thanks.

tejun


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to XXXX@XXXXX.COM
More majordomo info at http://www.yqcomputer.com/
Please read the FAQ at http://www.yqcomputer.com/
 
 
 

1. BUG: tab-completion produces unuseable paths when you are CD'd into a UNC path

2. [2.6.20.17 review 53/58] direct-io: fix error-path crashes

Need to initialize map_bh.b_state to zero. Otherwise, in case of a faulty
user-buffer its possible to go into dio_zero_block() and submit a page by
mistake - since it checks for buffer_new().

http://www.yqcomputer.com/

akpm: Linus had a (better) patch to just do a kzalloc() in there, but it got
lost. Probably this version is better for -stable anwyay.

Signed-off-by: Badari Pulavarty < XXXX@XXXXX.COM >
Acked-by: Joe Jin < XXXX@XXXXX.COM >
Acked-by: Zach Brown < XXXX@XXXXX.COM >
Cc: gurudas pai < XXXX@XXXXX.COM >
Signed-off-by: Andrew Morton < XXXX@XXXXX.COM >
Signed-off-by: Greg Kroah-Hartman < XXXX@XXXXX.COM >
Signed-off-by: Willy Tarreau < XXXX@XXXXX.COM >
---
fs/direct-io.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/fs/direct-io.c b/fs/direct-io.c
index d9d0833..0286993 100644
--- a/fs/direct-io.c
+++ b/fs/direct-io.c
@@ -978,6 +978,7 @@ direct_io_worker(int rw, struct kiocb *iocb, struct inode *inode,
dio->get_block = get_block;
dio->end_io = end_io;
dio->map_bh.b_private = NULL;
+ dio->map_bh.b_state = 0;
dio->final_block_in_bio = -1;
dio->next_block_for_io = -1;

--
1.5.2.5

--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to XXXX@XXXXX.COM
More majordomo info at http://www.yqcomputer.com/
Please read the FAQ at http://www.yqcomputer.com/

3. IO Completion & winsock BUG [???]

4. [patch] direct-io: bug fix in dio handling write error

5. Bug in CThreadPool::ThreadProc using IO Completion Ports and Socke

6. More overlapped IO and IO completion port questions

7. Question Field Completion Contingent Upon Other Field's Completion

8. automatic form completion - correction (was: automatic form completion)

9. bash completion: alternating between two bindings to the same key according to number of possible completions

10. Code completion, code parameters, block completion do not display.

11. Spelling Completion or Code completion in ASP?

12. seemingly superfluous completions from code in completion.el

13. Completion vs. Actual Completion

14. Estimate at Completion / Variance at Completion

15. psql tab completion bug and possible fix