diff options
| author | Jan Kara <jack@suse.cz> | 2026-03-20 10:04:29 +0100 |
|---|---|---|
| committer | Theodore Ts'o <tytso@mit.edu> | 2026-03-27 23:37:48 -0400 |
| commit | 0c90eed1b95335eba4f546e6742a8e4503d79349 (patch) | |
| tree | 794c12d6ea7d215ed397e39ab9ace6ddcce8868b /include/asm-powerpc/git@git.tavy.me:linux.git | |
| parent | d15e4b0a418537aafa56b2cb80d44add83e83697 (diff) | |
ext4: fix deadlock on inode reallocation
Currently there is a race in ext4 when reallocating freed inode
resulting in a deadlock:
Task1 Task2
ext4_evict_inode()
handle = ext4_journal_start();
...
if (IS_SYNC(inode))
handle->h_sync = 1;
ext4_free_inode()
ext4_new_inode()
handle = ext4_journal_start()
finds the bit in inode bitmap
already clear
insert_inode_locked()
waits for inode to be
removed from the hash.
ext4_journal_stop(handle)
jbd2_journal_stop(handle)
jbd2_log_wait_commit(journal, tid);
- deadlocks waiting for transaction handle Task2 holds
Fix the problem by removing inode from the hash already in
ext4_clear_inode() by which time all IO for the inode is done so reuse
is already fine but we are still before possibly blocking on transaction
commit.
Reported-by: "Lai, Yi" <yi1.lai@linux.intel.com>
Link: https://lore.kernel.org/all/abNvb2PcrKj1FBeC@ly-workstation
Fixes: 88ec797c4680 ("fs: make insert_inode_locked() wait for inode destruction")
CC: stable@vger.kernel.org
Signed-off-by: Jan Kara <jack@suse.cz>
Link: https://patch.msgid.link/20260320090428.24899-2-jack@suse.cz
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Cc: stable@kernel.org
Diffstat (limited to 'include/asm-powerpc/git@git.tavy.me:linux.git')
0 files changed, 0 insertions, 0 deletions
