Whamcloud - gitweb
LU-15590 libext2fs: fix direct I/O read 01/46601/2
authorJohn L. Hammond <jhammond@whamcloud.com>
Wed, 23 Feb 2022 22:27:38 +0000 (16:27 -0600)
committerAndreas Dilger <adilger@whamcloud.com>
Thu, 24 Feb 2022 20:11:43 +0000 (20:11 +0000)
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 <jhammond@whamcloud.com>
Change-Id: Ice42596be8e9db84fd49cbea25d3cd0fdf76589a
Reviewed-on: https://review.whamcloud.com/46601
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
lib/ext2fs/unix_io.c

index 5b2962f..09ea4fe 100644 (file)
@@ -311,7 +311,7 @@ bounce_read:
                        size += really_read;
                        goto short_read;
                }
-               actual = size;
+
                if (actual > align_size)
                        actual = align_size;
                actual -= offset;