diff options
author | Theodore Ts'o <tytso@mit.edu> | 2020-11-07 00:00:49 -0500 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2020-11-07 00:09:08 -0500 |
commit | 05d5233df85e9621597c5838e95235107eb624a2 (patch) | |
tree | 3c5f4ed1c18416092dac29bd1a1a87d6f17ff843 /fs/jbd2/checkpoint.c | |
parent | fa329e27317f7f0762001b9fb1e76c387a9db25d (diff) | |
download | linux-stable-05d5233df85e9621597c5838e95235107eb624a2.tar.gz linux-stable-05d5233df85e9621597c5838e95235107eb624a2.tar.bz2 linux-stable-05d5233df85e9621597c5838e95235107eb624a2.zip |
jbd2: fix up sparse warnings in checkpoint code
Add missing __acquires() and __releases() annotations. Also, in an
"this should never happen" WARN_ON check, if it *does* actually
happen, we need to release j_state_lock since this function is always
supposed to release that lock. Otherwise, things will quickly grind
to a halt after the WARN_ON trips.
Fixes: 96f1e0974575 ("jbd2: avoid long hold times of j_state_lock...")
Cc: stable@kernel.org
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'fs/jbd2/checkpoint.c')
-rw-r--r-- | fs/jbd2/checkpoint.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/jbd2/checkpoint.c b/fs/jbd2/checkpoint.c index 263f02ad8ebf..472932b9e6bc 100644 --- a/fs/jbd2/checkpoint.c +++ b/fs/jbd2/checkpoint.c @@ -106,6 +106,8 @@ static int __try_to_free_cp_buf(struct journal_head *jh) * for a checkpoint to free up some space in the log. */ void __jbd2_log_wait_for_space(journal_t *journal) +__acquires(&journal->j_state_lock) +__releases(&journal->j_state_lock) { int nblocks, space_left; /* assert_spin_locked(&journal->j_state_lock); */ |