From: Qu Wenruo Date: Mon, 22 Sep 2014 01:13:03 +0000 (+0800) Subject: btrfs: Fix the wrong condition judgment about subset extent map X-Git-Tag: v4.13~6519^2~15 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=32be3a1ac6d09576c57063c6c350ca36eaebdbd3;p=mirror_ubuntu-bionic-kernel.git btrfs: Fix the wrong condition judgment about subset extent map Previous commit: btrfs: Fix and enhance merge_extent_mapping() to insert best fitted extent map is using wrong condition to judgement whether the range is a subset of a existing extent map. This may cause bug in btrfs no-holes mode. This patch will correct the judgment and fix the bug. Signed-off-by: Qu Wenruo Signed-off-by: Chris Mason --- diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 344a322eb386..ef6fc587d964 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -6586,7 +6586,7 @@ insert: * extent causing the -EEXIST. */ if (start >= extent_map_end(existing) || - start + len <= existing->start) { + start <= existing->start) { /* * The existing extent map is the one nearest to * the [start, start + len) range which overlaps