Skip to content

Commit df41872

Browse files
Jack Qiutorvalds
authored andcommitted
fs: direct-io: fix missing sdio->boundary
I encountered a hung task issue, but not a performance one. I run DIO on a device (need lba continuous, for example open channel ssd), maybe hungtask in below case: DIO: Checkpoint: get addr A(at boundary), merge into BIO, no submit because boundary missing flush dirty data(get addr A+1), wait IO(A+1) writeback timeout, because DIO(A) didn't submit get addr A+2 fail, because checkpoint is doing dio_send_cur_page() may clear sdio->boundary, so prevent it from missing a boundary. Link: https://lkml.kernel.org/r/[email protected] Fixes: b1058b9 ("direct-io: submit bio after boundary buffer is added to it") Signed-off-by: Jack Qiu <[email protected]> Reviewed-by: Jan Kara <[email protected]> Cc: <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 7ad1e36 commit df41872

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

fs/direct-io.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -812,6 +812,7 @@ submit_page_section(struct dio *dio, struct dio_submit *sdio, struct page *page,
812812
struct buffer_head *map_bh)
813813
{
814814
int ret = 0;
815+
int boundary = sdio->boundary; /* dio_send_cur_page may clear it */
815816

816817
if (dio->op == REQ_OP_WRITE) {
817818
/*
@@ -850,10 +851,10 @@ submit_page_section(struct dio *dio, struct dio_submit *sdio, struct page *page,
850851
sdio->cur_page_fs_offset = sdio->block_in_file << sdio->blkbits;
851852
out:
852853
/*
853-
* If sdio->boundary then we want to schedule the IO now to
854+
* If boundary then we want to schedule the IO now to
854855
* avoid metadata seeks.
855856
*/
856-
if (sdio->boundary) {
857+
if (boundary) {
857858
ret = dio_send_cur_page(dio, sdio, map_bh);
858859
if (sdio->bio)
859860
dio_bio_submit(dio, sdio);

0 commit comments

Comments
 (0)