mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-15 21:23:23 +00:00
1 stable fix for a dm-cache 3.19-rc6 regression and 1 stable fix for
dm-thin: - fix DM cache metadata open/lookup error paths to properly use ERR_PTR and IS_ERR (fixes: 3.19-rc6 "stable" commit 9b1cc9f251) - fix DM thin-provisioning to disallow userspace from sending messages to the thin-pool if the pool is in READ_ONLY or FAIL mode since no metadata changes are not allowed in these modes. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAABAgAGBQJUyTJ8AAoJEMUj8QotnQNa4O0H/2f9FClhSdBUzohalVi6Vxd1 2S+b/EOVZGfQQhxNSoudJXxBAre3hxseQc17ofMBY1lzgDugkoRleH79fPacoqNX oE+CfrFuabY/I7ubIepQunaSiJ/9Ypetba0UGHqktXNRdyQ+ezHplPNcOP3NUwfq 0BfBDCHNdRMIz1ptZoXaeRP96oCziI9gRhkx+ChNmb7XxwHgYp96Bmk/UdYvitUT iThPkT5dXnHPMK09p7ZtrLfAk1QRWrkxJREAlR9df3FAn+kr+wZHz1CtL1m+05jC 7ADssIzeSldeeYcfLC0z5joVNxD0A+QKtPMz/gHvbzhxWmTcCrrIOZzXeF5c89w= =f9jv -----END PGP SIGNATURE----- Merge tag 'dm-3.19-fixes-3' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm Pull device mapper fixes from Mike Snitzer: "One stable fix for a dm-cache 3.19-rc6 regression and one stable fix for dm-thin: - fix DM cache metadata open/lookup error paths to properly use ERR_PTR and IS_ERR (fixes: 3.19-rc6 "stable" commit 9b1cc9f251) - fix DM thin-provisioning to disallow userspace from sending messages to the thin-pool if the pool is in READ_ONLY or FAIL mode since no metadata changes are allowed in these modes" * tag 'dm-3.19-fixes-3' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm: dm thin: don't allow messages to be sent to a pool target in READ_ONLY or FAIL mode dm cache: fix missing ERR_PTR returns and handling
This commit is contained in:
commit
1c999c47a9
@ -683,7 +683,7 @@ static struct dm_cache_metadata *metadata_open(struct block_device *bdev,
|
||||
cmd = kzalloc(sizeof(*cmd), GFP_KERNEL);
|
||||
if (!cmd) {
|
||||
DMERR("could not allocate metadata struct");
|
||||
return NULL;
|
||||
return ERR_PTR(-ENOMEM);
|
||||
}
|
||||
|
||||
atomic_set(&cmd->ref_count, 1);
|
||||
@ -745,7 +745,7 @@ static struct dm_cache_metadata *lookup_or_open(struct block_device *bdev,
|
||||
return cmd;
|
||||
|
||||
cmd = metadata_open(bdev, data_block_size, may_format_device, policy_hint_size);
|
||||
if (cmd) {
|
||||
if (!IS_ERR(cmd)) {
|
||||
mutex_lock(&table_lock);
|
||||
cmd2 = lookup(bdev);
|
||||
if (cmd2) {
|
||||
@ -780,9 +780,10 @@ struct dm_cache_metadata *dm_cache_metadata_open(struct block_device *bdev,
|
||||
{
|
||||
struct dm_cache_metadata *cmd = lookup_or_open(bdev, data_block_size,
|
||||
may_format_device, policy_hint_size);
|
||||
if (cmd && !same_params(cmd, data_block_size)) {
|
||||
|
||||
if (!IS_ERR(cmd) && !same_params(cmd, data_block_size)) {
|
||||
dm_cache_metadata_close(cmd);
|
||||
return NULL;
|
||||
return ERR_PTR(-EINVAL);
|
||||
}
|
||||
|
||||
return cmd;
|
||||
|
@ -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);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user