Skip to content

Commit

Permalink
[bcache] bcache_invalidate_fd, only remove prefixes on success.
Browse files Browse the repository at this point in the history
  • Loading branch information
jthornber committed Oct 29, 2019
1 parent 7e8296f commit 25e7bf0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/device/bcache.c
Original file line number Diff line number Diff line change
Expand Up @@ -1376,7 +1376,10 @@ bool bcache_invalidate_fd(struct bcache *cache, int fd)
it.success = true;
it.it.visit = _invalidate_v;
radix_tree_iterate(cache->rtree, k.bytes, k.bytes + sizeof(k.parts.fd), &it.it);
radix_tree_remove_prefix(cache->rtree, k.bytes, k.bytes + sizeof(k.parts.fd));

if (it.success)
radix_tree_remove_prefix(cache->rtree, k.bytes, k.bytes + sizeof(k.parts.fd));

return it.success;
}

Expand Down

0 comments on commit 25e7bf0

Please sign in to comment.