From: John L. Hammond Date: Wed, 23 Feb 2022 22:27:38 +0000 (-0600) Subject: LU-15590 libext2fs: fix direct I/O read X-Git-Tag: v1.46.2.wc5~2 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=980a75706e0ea08efc3138727fde0bf9440bee1c;p=tools%2Fe2fsprogs.git LU-15590 libext2fs: fix direct I/O read In the direct I/O bounce buffer case of raw_read_blk(), don't clobber "actual" with "size" after reading. Fixes: d557b965 libext2fs: fix potential races in unix_io Signed-off-by: John L. Hammond Change-Id: Ice42596be8e9db84fd49cbea25d3cd0fdf76589a Reviewed-on: https://review.whamcloud.com/46601 Tested-by: jenkins Reviewed-by: Andreas Dilger Tested-by: Maloo --- diff --git a/lib/ext2fs/unix_io.c b/lib/ext2fs/unix_io.c index 5b2962f..09ea4fe 100644 --- a/lib/ext2fs/unix_io.c +++ b/lib/ext2fs/unix_io.c @@ -311,7 +311,7 @@ bounce_read: size += really_read; goto short_read; } - actual = size; + if (actual > align_size) actual = align_size; actual -= offset;