summaryrefslogtreecommitdiff
path: root/drivers/md/dm-thin.c
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2015-02-20 11:54:53 -0800
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2015-02-20 11:54:53 -0800
commit4c971aa78314253cce914ed29e3d90df3326d646 (patch)
treea9dcf0b1fdc9e1aacff90afb5b3ab79983115dcc /drivers/md/dm-thin.c
parent4ba24fef3eb3b142197135223b90ced2f319cd53 (diff)
parent290b799c390d77d27effee3ce312203aaa32ee74 (diff)
Merge branch 'next' into for-linus
Second round of updates for 3.20.
Diffstat (limited to 'drivers/md/dm-thin.c')
-rw-r--r--drivers/md/dm-thin.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/md/dm-thin.c b/drivers/md/dm-thin.c
index 493478989dbd..07705ee181e3 100644
--- a/drivers/md/dm-thin.c
+++ b/drivers/md/dm-thin.c
@@ -3385,6 +3385,12 @@ static int pool_message(struct dm_target *ti, unsigned argc, char **argv)
struct pool_c *pt = ti->private;
struct pool *pool = pt->pool;
+ if (get_pool_mode(pool) >= PM_READ_ONLY) {
+ DMERR("%s: unable to service pool target messages in READ_ONLY or FAIL mode",
+ dm_device_name(pool->pool_md));
+ return -EINVAL;
+ }
+
if (!strcasecmp(argv[0], "create_thin"))
r = process_create_thin_mesg(argc, argv, pool);