Whamcloud - gitweb
LU-2473 ldiskfs: Reorganize ldiskfs kernel patches
[fs/lustre-release.git] / ldiskfs / kernel_patches / patches / rhel6.3 / ext4-fix-ext4_mb_add_n_trim.patch
1 Index: linux-stage/fs/ext4/mballoc.c
2 ===================================================================
3 --- linux-stage.orig/fs/ext4/mballoc.c
4 +++ linux-stage/fs/ext4/mballoc.c
5 @@ -4352,7 +4352,7 @@ static void ext4_mb_add_n_trim(struct ex
6                 /* The max size of hash table is PREALLOC_TB_SIZE */
7                 order = PREALLOC_TB_SIZE - 1;
8         /* Add the prealloc space to lg */
9 -       rcu_read_lock();
10 +       spin_lock(&lg->lg_prealloc_lock);
11         list_for_each_entry_rcu(tmp_pa, &lg->lg_prealloc_list[order],
12                                                 pa_inode_list) {
13                 spin_lock(&tmp_pa->pa_lock);
14 @@ -4376,7 +4376,7 @@ static void ext4_mb_add_n_trim(struct ex
15         if (!added)
16                 list_add_tail_rcu(&pa->pa_inode_list,
17                                         &lg->lg_prealloc_list[order]);
18 -       rcu_read_unlock();
19 +       spin_unlock(&lg->lg_prealloc_lock);
20
21         /* Now trim the list to be not more than 8 elements */
22         if (lg_prealloc_count > 8) {