From 980a75706e0ea08efc3138727fde0bf9440bee1c Mon Sep 17 00:00:00 2001 From: "John L. Hammond" Date: Wed, 23 Feb 2022 16:27:38 -0600 Subject: [PATCH] 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 --- lib/ext2fs/unix_io.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- 1.8.3.1