Whamcloud - gitweb
f54fc1a93284356735ad272b06b378bcfd5e30bd
[fs/lustre-release.git] / ldiskfs / kernel_patches / patches / rhel6.3 / ext4-recalc-percpu-counters-after-journal.patch
1 --- linux-stage.orig/fs/ext4/super.c
2 +++ linux-stage/fs/ext4/super.c
3 @@ -3613,6 +3613,18 @@ static int ext4_fill_super(struct super_
4  
5         sbi->s_journal->j_commit_callback = ext4_journal_commit_callback;
6  
7 +       /*
8 +        * The journal may have updated the bg summary counts, so we
9 +        * need to update the global counters.
10 +        */
11 +       percpu_counter_set(&sbi->s_freeblocks_counter,
12 +                          ext4_count_free_blocks(sb));
13 +       percpu_counter_set(&sbi->s_freeinodes_counter,
14 +                          ext4_count_free_inodes(sb));
15 +       percpu_counter_set(&sbi->s_dirs_counter,
16 +                          ext4_count_dirs(sb));
17 +       percpu_counter_set(&sbi->s_dirtyblocks_counter, 0);
18 +
19  no_journal:
20  
21         if (test_opt(sb, NOBH)) {