Whamcloud - gitweb
libext2fs: don't old the CACHE_MTX while doing I/O
authorTheodore Ts'o <tytso@mit.edu>
Thu, 9 Dec 2021 15:55:54 +0000 (10:55 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Thu, 9 Dec 2021 15:55:54 +0000 (10:55 -0500)
commit699d448eee4b991acafaae4e4f8222be332d6837
treeaa8c4e14df15d593d2e085d5d3931ade2cd61c64
parent54183fea07676d185b2c169c45a7c1adc7e3e26e
libext2fs: don't old the CACHE_MTX while doing I/O

A report a deadlock problem caused by I/O errors (caused by e2fsck's
error handler trying to write to a bad block to perform a forced
rewrite) uncovered that we were holding the CACHE_MTX while doing read
operations.  This serialized read operations which destroyed the
performance benefits from doing parallel bitmap loading (or the
parallel e2fsck processing under development).

So restructure the code in unix_read_blk64() so that the read is
always done into the user-provided buffer, and then copied into the
cache afterwards.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
lib/ext2fs/unix_io.c