[PATCH] btrfs: block group: do not exclude bytenr adjacent to block group

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Su Yue <Damenly_Su@xxxxxxx>

while excluding super stripes from one block group, the logical bytenr
should not be excluded if the block group's start + length equals the
bytenr since the bytenr is not belong to the block group.

This is insipred by same bugous code of btrfs-progs.
The fuzz image is rejected to be mounted by tree-checker, but not
bad to enhance the check in practice.

Signed-off-by: Su Yue <Damenly_Su@xxxxxxx>
---
 fs/btrfs/block-group.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/btrfs/block-group.c b/fs/btrfs/block-group.c
index 1e521db3ef56..54f970f459f5 100644
--- a/fs/btrfs/block-group.c
+++ b/fs/btrfs/block-group.c
@@ -1539,7 +1539,7 @@ static int exclude_super_stripes(struct btrfs_block_group_cache *cache)
 		while (nr--) {
 			u64 start, len;
 
-			if (logical[nr] > cache->start + cache->length)
+			if (logical[nr] >= cache->start + cache->length)
 				continue;
 
 			if (logical[nr] + stripe_len <= cache->start)
-- 
2.23.0




[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux