1 --- linux-stage/fs/ext4/mballoc.c 2016-11-25 04:15:25.824396109 +0530
2 +++ linux-stage.orig/fs/ext4/mballoc.c 2016-11-25 02:59:13.505151246 +0530
4 unsigned short max = EXT4_CLUSTERS_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 @@ -3969,6 +3974,14 @@
20 +#ifdef HAVE_CLEAR_RDONLY_ON_PUT
21 + /* be quiet if readonly device */
22 + if (dev_check_rdonly(sb->s_bdev)) {
23 + atomic_add(free, &sbi->s_mb_discarded);
27 /* "free < pa->pa_free" means we maybe double alloc the same blocks,
28 * otherwise maybe leave some free blocks unavailable, no need to BUG.*/
29 if ((free > pa->pa_free && !pa->pa_error) || (free < pa->pa_free)) {