Commit 92e9c58c authored by Madhuparna Bhowmik's avatar Madhuparna Bhowmik Committed by Theodore Ts'o

ext4: use built-in RCU list checking in mballoc

list_for_each_entry_rcu() has built-in RCU and lock checking.

Pass cond argument to list_for_each_entry_rcu() to silence
false lockdep warning when CONFIG_PROVE_RCU_LIST is enabled
by default.
Signed-off-by: default avatarMadhuparna Bhowmik <madhuparnabhowmik10@gmail.com>
Link: https://lore.kernel.org/r/20200213152558.7070-1-madhuparnabhowmik10@gmail.comSigned-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
parent 765bfcd5
...@@ -4302,7 +4302,8 @@ ext4_mb_discard_lg_preallocations(struct super_block *sb, ...@@ -4302,7 +4302,8 @@ ext4_mb_discard_lg_preallocations(struct super_block *sb,
spin_lock(&lg->lg_prealloc_lock); spin_lock(&lg->lg_prealloc_lock);
list_for_each_entry_rcu(pa, &lg->lg_prealloc_list[order], list_for_each_entry_rcu(pa, &lg->lg_prealloc_list[order],
pa_inode_list) { pa_inode_list,
lockdep_is_held(&lg->lg_prealloc_lock)) {
spin_lock(&pa->pa_lock); spin_lock(&pa->pa_lock);
if (atomic_read(&pa->pa_count)) { if (atomic_read(&pa->pa_count)) {
/* /*
...@@ -4386,7 +4387,8 @@ static void ext4_mb_add_n_trim(struct ext4_allocation_context *ac) ...@@ -4386,7 +4387,8 @@ static void ext4_mb_add_n_trim(struct ext4_allocation_context *ac)
/* Add the prealloc space to lg */ /* Add the prealloc space to lg */
spin_lock(&lg->lg_prealloc_lock); spin_lock(&lg->lg_prealloc_lock);
list_for_each_entry_rcu(tmp_pa, &lg->lg_prealloc_list[order], list_for_each_entry_rcu(tmp_pa, &lg->lg_prealloc_list[order],
pa_inode_list) { pa_inode_list,
lockdep_is_held(&lg->lg_prealloc_lock)) {
spin_lock(&tmp_pa->pa_lock); spin_lock(&tmp_pa->pa_lock);
if (tmp_pa->pa_deleted) { if (tmp_pa->pa_deleted) {
spin_unlock(&tmp_pa->pa_lock); spin_unlock(&tmp_pa->pa_lock);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment