Whamcloud - gitweb
libext2fs: unix_io: fix_potential error path deadlock in flush_cached_blocks()
authorTheodore Ts'o <tytso@mit.edu>
Tue, 31 Jan 2023 05:19:47 +0000 (00:19 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Wed, 1 Feb 2023 05:39:18 +0000 (00:39 -0500)
commit0e0c7537eb5fdcef9a90b1a3ed8365c3878392a1
treed24337ca2b7f6a8795eda025d29a245e04992eb7
parentf6cb7f010d137f83a37d1de375a9e73a84c4edf1
libext2fs: unix_io: fix_potential error path deadlock in flush_cached_blocks()

We can't call the error handler while holding the CACHE_MUTEX (see
previous commit, "libext2fs: unix_io: fix_potential error path
deadlock in reuse_cache()" for details), so first try to write out all
of the dirty blocks in the cache, and then for those where we had
errors, then call the error handler.

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