dm btree: fix bufio buffer leaks in dm_btree_del() error path
authorJoe Thornber <ejt@redhat.com>
Thu, 10 Dec 2015 14:37:53 +0000 (14:37 +0000)
committerMike Snitzer <snitzer@redhat.com>
Thu, 10 Dec 2015 15:30:18 +0000 (10:30 -0500)
commited8b45a3679eb49069b094c0711b30833f27c734
treeaf96251b78543f6426d3f3488350bf57b06ac584
parent50dd842ad83b43bed71790efb31cfb2f6c05c9c1
dm btree: fix bufio buffer leaks in dm_btree_del() error path

If dm_btree_del()'s call to push_frame() fails, e.g. due to
btree_node_validator finding invalid metadata, the dm_btree_del() error
path must unlock all frames (which have active dm-bufio buffers) that
were pushed onto the del_stack.

Otherwise, dm_bufio_client_destroy() will BUG_ON() because dm-bufio
buffers have leaked, e.g.:
  device-mapper: bufio: leaked buffer 3, hold count 1, list 0

Signed-off-by: Joe Thornber <ejt@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Cc: stable@vger.kernel.org
drivers/md/persistent-data/dm-btree.c