Btrfs: fix a double free on pending snapshots in error handling
authorLiu Bo <bo.li.liu@oracle.com>
Mon, 5 Nov 2012 12:42:09 +0000 (12:42 +0000)
committerJosef Bacik <jbacik@fusionio.com>
Wed, 12 Dec 2012 22:15:25 +0000 (17:15 -0500)
commite1fd8ad0f2db497850008b49778fce53821c2fc4
tree60be3ee8c1154534a691c8136ce3e39e69c7cc00
parent54fe522b0178cde8fe69ab1ca01d751ca6544c2f
Btrfs: fix a double free on pending snapshots in error handling

When creating a snapshot, failing to commit a transaction can end up
with aborting the transaction, following by doing a cleanup for it, where
we'll free all snapshots pending to disk.

So we check it and avoid double free on pending snapshots.

Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
fs/btrfs/ioctl.c