Whamcloud - gitweb
LU-8364 ldiskfs: fixes for failover mode
[fs/lustre-release.git] / ldiskfs / kernel_patches / patches / rhel6.3 / ext4-dont-check-in-ro.patch
1 --- linux-stage/fs/ext4/mballoc.c       2016-11-25 15:31:40.353249364 +0530
2 +++ linux-stage.orig/fs/ext4/mballoc.c  2016-11-25 15:35:07.816249363 +0530
3 @@ -3369,6 +3369,11 @@
4         unsigned short max = EXT4_BLOCKS_PER_GROUP(sb);
5         unsigned short i, first, free = 0;
6  
7 +#ifdef HAVE_CLEAR_RDONLY_ON_PUT
8 +       /* be quiet if readonly device */
9 +       if (dev_check_rdonly(sb->s_bdev))
10 +               return 0;
11 +#endif
12         i = mb_find_next_zero_bit(bitmap, max, 0);
13  
14         while (i < max) {
15 @@ -3750,6 +3755,13 @@
16                 bit = next + 1;
17         }
18  
19 +#ifdef HAVE_CLEAR_RDONLY_ON_PUT
20 +       /* be quiet if readonly device */
21 +       if (dev_check_rdonly(sb->s_bdev)) {
22 +               atomic_add(free, &sbi->s_mb_discarded);
23 +               return err;
24 +       }
25 +#endif
26         /* "free < pa->pa_free" means we maybe double alloc the same blocks,
27          * otherwise maybe leave some free blocks unavailable, no need to BUG.*/
28         if ((free > pa->pa_free && !pa->pa_error) || (free < pa->pa_free)) {