dm thin: re-establish read-only state when switching to fail mode
authorJoe Thornber <ejt@redhat.com>
Wed, 4 Dec 2013 21:30:01 +0000 (16:30 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 20 Dec 2013 15:49:05 +0000 (07:49 -0800)
commit6aa06206adee5208abb1f2313fa0017e099ec9a4
treea85c1357dd44b8dfac28a435acfacbca102cebae
parenta016a0dfee64bcf6f08cb0129574b91a280b092e
dm thin: re-establish read-only state when switching to fail mode

commit 5383ef3a929a1366e2ced45cd6d74be7aa2a2281 upstream.

If the thin-pool transitioned to fail mode and the thin-pool's table
were reloaded for some reason: the new table's default pool mode would
be read-write, though it will transition to fail mode during resume.

When the pool mode transitions directly from PM_WRITE to PM_FAIL we need
to re-establish the intermediate read-only state in both the metadata
and persistent-data block manager (as is usually done with the normal
pool mode transition sequence: PM_WRITE -> PM_READ_ONLY -> PM_FAIL).

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