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
4 unsigned short max = EXT4_BLOCKS_PER_GROUP(sb);
5 unsigned short i, first, free = 0;
7 +#ifdef HAVE_CLEAR_RDONLY_ON_PUT
8 + /* be quiet if readonly device */
9 + if (dev_check_rdonly(sb->s_bdev))
12 i = mb_find_next_zero_bit(bitmap, max, 0);
15 @@ -3750,6 +3755,13 @@
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);
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)) {