dm thin: fix missing out-of-data-space to write mode transition if blocks are released
commit63027d8810ee41ebb92d183c2e95ee620f8503cb
authorJoe Thornber <ejt@redhat.com>
Thu, 11 Dec 2014 11:12:19 +0000 (11 11:12 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 8 Jan 2015 18:27:46 +0000 (8 10:27 -0800)
treeb83c88b4c362177202060e9945afc707fc65328e
parentc668ccfbf30acf376ff38b502240643d3d61cfd5
dm thin: fix missing out-of-data-space to write mode transition if blocks are released

commit 2c43fd26e46734430122b8d2ad3024bb532df3ef upstream.

Discard bios and thin device deletion have the potential to release data
blocks.  If the thin-pool is in out-of-data-space mode, and blocks were
released, transition the thin-pool back to full write mode.

The correct time to do this is just after the thin-pool metadata commit.
It cannot be done before the commit because the space maps will not
allow immediate reuse of the data blocks in case there's a rollback
following power failure.

Signed-off-by: Joe Thornber <ejt@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/md/dm-thin.c