dm thin metadata: remove incorrect close_device on creation error paths
authorMike Snitzer <snitzer@redhat.com>
Wed, 7 Mar 2012 19:09:41 +0000 (19:09 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 12 Mar 2012 19:31:41 +0000 (12:31 -0700)
commit6cb44f13d19edb09a4d53cef4d17773d9bb03e39
tree68416178b49338b6d7e46885fddacd4fc9b571cc
parent4175e9d6c44519cd60f4a9efbf031cfa37e42be2
dm thin metadata: remove incorrect close_device on creation error paths

commit 1f3db25d8be4ac50b897b39609802183ea68a514 upstream.

The __open_device() error paths in __create_thin() and __create_snap()
incorrectly call __close_device() even if td was not initialized by
__open_device().  Remove this.

Also document __open_device() return values, remove a redundant
td->changed = 1 in __create_thin(), and insert an additional
safeguard against creating an already-existing device.

Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/md/dm-thin-metadata.c