diff options
-rw-r--r-- | fs/ext4/mballoc.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c index 1bf6fe785c4f..061727acd990 100644 --- a/fs/ext4/mballoc.c +++ b/fs/ext4/mballoc.c | |||
@@ -4136,7 +4136,7 @@ static void ext4_mb_add_n_trim(struct ext4_allocation_context *ac) | |||
4136 | /* The max size of hash table is PREALLOC_TB_SIZE */ | 4136 | /* The max size of hash table is PREALLOC_TB_SIZE */ |
4137 | order = PREALLOC_TB_SIZE - 1; | 4137 | order = PREALLOC_TB_SIZE - 1; |
4138 | /* Add the prealloc space to lg */ | 4138 | /* Add the prealloc space to lg */ |
4139 | rcu_read_lock(); | 4139 | spin_lock(&lg->lg_prealloc_lock); |
4140 | list_for_each_entry_rcu(tmp_pa, &lg->lg_prealloc_list[order], | 4140 | list_for_each_entry_rcu(tmp_pa, &lg->lg_prealloc_list[order], |
4141 | pa_inode_list) { | 4141 | pa_inode_list) { |
4142 | spin_lock(&tmp_pa->pa_lock); | 4142 | spin_lock(&tmp_pa->pa_lock); |
@@ -4160,12 +4160,12 @@ static void ext4_mb_add_n_trim(struct ext4_allocation_context *ac) | |||
4160 | if (!added) | 4160 | if (!added) |
4161 | list_add_tail_rcu(&pa->pa_inode_list, | 4161 | list_add_tail_rcu(&pa->pa_inode_list, |
4162 | &lg->lg_prealloc_list[order]); | 4162 | &lg->lg_prealloc_list[order]); |
4163 | rcu_read_unlock(); | 4163 | spin_unlock(&lg->lg_prealloc_lock); |
4164 | 4164 | ||
4165 | /* Now trim the list to be not more than 8 elements */ | 4165 | /* Now trim the list to be not more than 8 elements */ |
4166 | if (lg_prealloc_count > 8) { | 4166 | if (lg_prealloc_count > 8) { |
4167 | ext4_mb_discard_lg_preallocations(sb, lg, | 4167 | ext4_mb_discard_lg_preallocations(sb, lg, |
4168 | order, lg_prealloc_count); | 4168 | order, lg_prealloc_count); |
4169 | return; | 4169 | return; |
4170 | } | 4170 | } |
4171 | return ; | 4171 | return ; |