summaryrefslogtreecommitdiffstats
path: root/drivers/md/bcache/btree.c
diff options
context:
space:
mode:
authorKent Overstreet <kmo@daterainc.com>2013-07-28 18:35:09 -0700
committerKent Overstreet <kmo@daterainc.com>2014-01-08 13:05:12 -0800
commit911c9610099f26e9e6ea3d1962ce24f53890b163 (patch)
tree21dc0ae5850dc64756974aedacc0380a3e01b12e /drivers/md/bcache/btree.c
parentfafff81cead78157099df1ee10af16cc51893ddc (diff)
downloadop-kernel-dev-911c9610099f26e9e6ea3d1962ce24f53890b163.zip
op-kernel-dev-911c9610099f26e9e6ea3d1962ce24f53890b163.tar.gz
bcache: Split out sort_extent_cmp()
Only use extent comparison for comparing extents, so we're not using START_KEY() on other key types (i.e. btree pointers) Signed-off-by: Kent Overstreet <kmo@daterainc.com>
Diffstat (limited to 'drivers/md/bcache/btree.c')
-rw-r--r--drivers/md/bcache/btree.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/md/bcache/btree.c b/drivers/md/bcache/btree.c
index 8aaaf16..e1e36e7 100644
--- a/drivers/md/bcache/btree.c
+++ b/drivers/md/bcache/btree.c
@@ -1854,10 +1854,16 @@ static bool fix_overlapping_extents(struct btree *b, struct bkey *insert,
while (1) {
struct bkey *k = bch_btree_iter_next(iter);
- if (!k ||
- bkey_cmp(&START_KEY(k), insert) >= 0)
+ if (!k)
break;
+ if (bkey_cmp(&START_KEY(k), insert) >= 0) {
+ if (KEY_SIZE(k))
+ break;
+ else
+ continue;
+ }
+
if (bkey_cmp(k, &START_KEY(insert)) <= 0)
continue;
OpenPOWER on IntegriCloud