From: Naohiro Aota Date: Tue, 30 Jun 2015 02:25:43 +0000 (+0900) Subject: btrfs: fix search key advancing condition X-Git-Tag: omap-for-v4.3/fixes-rc1~86^2~38 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dd81d459a37d73cfa39896bd070e7b92e66e3628;p=pandora-kernel.git btrfs: fix search key advancing condition The search key advancing condition used in copy_to_sk() is loose. It can advance the key even if it reaches sk->max_*: e.g. when the max key = (512, 1024, -1) and the current key = (512, 1025, 10), it increments the offset by 1, continues hopeless search from (512, 1025, 11). This issue make ioctl() to take unexpectedly long time scanning all the leaf a blocks one by one. This commit fix the problem using standard way of key comparison: btrfs_comp_cpu_keys() Signed-off-by: Naohiro Aota Reviewed-by: Filipe Manana Signed-off-by: Chris Mason --- Reading git-diff-tree failed