* [PATCH] fs/jbd2: use a weaker annotation in journal handling
@ 2025-10-24 7:39 Byungchul Park
2025-11-17 19:13 ` Theodore Ts'o
0 siblings, 1 reply; 2+ messages in thread
From: Byungchul Park @ 2025-10-24 7:39 UTC (permalink / raw)
To: tytso, jack; +Cc: kernel_team, linux-ext4, linux-kernel
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>
---
Hi,
I found this issue during DEPT development but it's still favorable in
any case for more precise annotation.
Byungchul
---
fs/jbd2/transaction.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/jbd2/transaction.c b/fs/jbd2/transaction.c
index c7867139af69..b4e65f51bf5e 100644
--- a/fs/jbd2/transaction.c
+++ b/fs/jbd2/transaction.c
@@ -441,7 +441,7 @@ static int start_this_handle(journal_t *journal, handle_t *handle,
read_unlock(&journal->j_state_lock);
current->journal_info = handle;
- rwsem_acquire_read(&journal->j_trans_commit_map, 0, 0, _THIS_IP_);
+ rwsem_acquire_read(&journal->j_trans_commit_map, 0, 1, _THIS_IP_);
jbd2_journal_free_transaction(new_transaction);
/*
* Ensure that no allocations done while the transaction is open are
--
2.17.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] fs/jbd2: use a weaker annotation in journal handling
2025-10-24 7:39 [PATCH] fs/jbd2: use a weaker annotation in journal handling Byungchul Park
@ 2025-11-17 19:13 ` Theodore Ts'o
0 siblings, 0 replies; 2+ messages in thread
From: Theodore Ts'o @ 2025-11-17 19:13 UTC (permalink / raw)
To: jack, Byungchul Park
Cc: Theodore Ts'o, kernel_team, linux-ext4, linux-kernel
On Fri, 24 Oct 2025 16:39:40 +0900, Byungchul Park wrote:
> 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.
>
> [...]
Applied, thanks!
[1/1] fs/jbd2: use a weaker annotation in journal handling
commit: 40a71b53d5a6d4ea17e4d54b99b2ac03a7f5e783
Best regards,
--
Theodore Ts'o <tytso@mit.edu>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-11-17 19:14 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-10-24 7:39 [PATCH] fs/jbd2: use a weaker annotation in journal handling Byungchul Park
2025-11-17 19:13 ` Theodore Ts'o
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®