summaryrefslogtreecommitdiff
path: root/drivers/md
diff options
context:
space:
mode:
authorKent Overstreet <kmo@daterainc.com>2013-12-07 11:57:58 (GMT)
committerKent Overstreet <kmo@daterainc.com>2014-01-08 21:05:14 (GMT)
commit3b3e9e50dd951725130645660b526c4f367dcdee (patch)
tree860b547a43c62e0e1b578c5f3adabbb3a031d5bd /drivers/md
parente0a985a4b1b533311ec88c85177c45d036313f75 (diff)
downloadlinux-3b3e9e50dd951725130645660b526c4f367dcdee.tar.xz
bcache: Don't return -EINTR when insert finished
We need to return -EINTR after a split because we invalidated iterators (and freed the btree node) - but if we were finished inserting, we don't want to redo the traversal. Signed-off-by: Kent Overstreet <kmo@daterainc.com>
Diffstat (limited to 'drivers/md')
-rw-r--r--drivers/md/bcache/btree.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/md/bcache/btree.c b/drivers/md/bcache/btree.c
index 463d280..98cc0a8 100644
--- a/drivers/md/bcache/btree.c
+++ b/drivers/md/bcache/btree.c
@@ -2002,8 +2002,10 @@ static int bch_btree_insert_node(struct btree *b, struct btree_op *op,
return -EINTR;
} else {
/* Invalidated all iterators */
- return btree_split(b, op, insert_keys, replace_key) ?:
- -EINTR;
+ int ret = btree_split(b, op, insert_keys, replace_key);
+
+ return bch_keylist_empty(insert_keys) ?
+ 0 : ret ?: -EINTR;
}
} else {
BUG_ON(write_block(b) != btree_bset_last(b));