e2fsprogs icon indicating copy to clipboard operation
e2fsprogs copied to clipboard

improper locking due to unreleased locks

Open ryancaicse opened this issue 3 years ago • 2 comments

Hi, developers, thank you for your checking. It seems two locks CACHE_MTX and BOUNCE_MTX are not released correctly when retval = flush_cached_blocks(channel, data, FLUSH_NOLOCK) returns true in the function unix_set_blksize?

https://github.com/tytso/e2fsprogs/blob/f158f8962ed7e884fa168f354c488f3afa3eb6db/lib/ext2fs/unix_io.c#L957-L968

ryancaicse avatar Oct 29 '21 09:10 ryancaicse

Looks like a deadlock is going to happen.

hifilove avatar Nov 02 '21 09:11 hifilove

@hifi521 yes, there are possible deadlocks due to the missing releases of these two locks.

ryancaicse avatar Nov 02 '21 10:11 ryancaicse