Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f6175efa authored by Liu Bo's avatar Liu Bo Committed by Chris Mason
Browse files

Btrfs: do not count in readonly bytes



If a block group is ro, do not count its entries in when we dump space info.

Signed-off-by: default avatarLiu Bo <liubo2009@cn.fujitsu.com>
Signed-off-by: default avatarJosef Bacik <jbacik@fusionio.com>
parent 799ffc3c
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -1968,7 +1968,7 @@ void btrfs_dump_free_space(struct btrfs_block_group_cache *block_group,


	for (n = rb_first(&ctl->free_space_offset); n; n = rb_next(n)) {
	for (n = rb_first(&ctl->free_space_offset); n; n = rb_next(n)) {
		info = rb_entry(n, struct btrfs_free_space, offset_index);
		info = rb_entry(n, struct btrfs_free_space, offset_index);
		if (info->bytes >= bytes)
		if (info->bytes >= bytes && !block_group->ro)
			count++;
			count++;
		printk(KERN_CRIT "entry offset %llu, bytes %llu, bitmap %s\n",
		printk(KERN_CRIT "entry offset %llu, bytes %llu, bitmap %s\n",
		       (unsigned long long)info->offset,
		       (unsigned long long)info->offset,