Skip to content

Commit 40a71b5

Browse files
Byungchul Parktytso
authored andcommitted
jbd2: use a weaker annotation in journal handling
jbd2 journal handling code doesn't want jbd2_might_wait_for_commit() to be placed between start_this_handle() and stop_this_handle(). So it marks the region with rwsem_acquire_read() and rwsem_release(). However, the annotation is too strong for that purpose. We don't have to use more than try lock annotation for that. rwsem_acquire_read() implies: 1. might be a waiter on contention of the lock. 2. enter to the critical section of the lock. All we need in here is to act 2, not 1. So trylock version of annotation is sufficient for that purpose. Now that dept partially relies on lockdep annotaions, dept interpets rwsem_acquire_read() as a potential wait and might report a deadlock by the wait. Replace it with trylock version of annotation. Signed-off-by: Byungchul Park <byungchul@sk.com> Reviewed-by: Jan Kara <jack@suse.cz> Cc: stable@kernel.org Message-ID: <20251024073940.1063-1-byungchul@sk.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
1 parent 524c385 commit 40a71b5

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

fs/jbd2/transaction.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ static int start_this_handle(journal_t *journal, handle_t *handle,
441441
read_unlock(&journal->j_state_lock);
442442
current->journal_info = handle;
443443

444-
rwsem_acquire_read(&journal->j_trans_commit_map, 0, 0, _THIS_IP_);
444+
rwsem_acquire_read(&journal->j_trans_commit_map, 0, 1, _THIS_IP_);
445445
jbd2_journal_free_transaction(new_transaction);
446446
/*
447447
* Ensure that no allocations done while the transaction is open are

0 commit comments

Comments
 (0)