Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

+11 -4
+5 -4
drivers/md/dm-cache-metadata.c
··· 683 683 cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); 684 684 if (!cmd) { 685 685 DMERR("could not allocate metadata struct"); 686 - return NULL; 686 + return ERR_PTR(-ENOMEM); 687 687 } 688 688 689 689 atomic_set(&cmd->ref_count, 1); ··· 745 745 return cmd; 746 746 747 747 cmd = metadata_open(bdev, data_block_size, may_format_device, policy_hint_size); 748 - if (cmd) { 748 + if (!IS_ERR(cmd)) { 749 749 mutex_lock(&table_lock); 750 750 cmd2 = lookup(bdev); 751 751 if (cmd2) { ··· 780 780 { 781 781 struct dm_cache_metadata *cmd = lookup_or_open(bdev, data_block_size, 782 782 may_format_device, policy_hint_size); 783 - if (cmd && !same_params(cmd, data_block_size)) { 783 + 784 + if (!IS_ERR(cmd) && !same_params(cmd, data_block_size)) { 784 785 dm_cache_metadata_close(cmd); 785 - return NULL; 786 + return ERR_PTR(-EINVAL); 786 787 } 787 788 788 789 return cmd;
+6
drivers/md/dm-thin.c
··· 3385 3385 struct pool_c *pt = ti->private; 3386 3386 struct pool *pool = pt->pool; 3387 3387 3388 + if (get_pool_mode(pool) >= PM_READ_ONLY) { 3389 + DMERR("%s: unable to service pool target messages in READ_ONLY or FAIL mode", 3390 + dm_device_name(pool->pool_md)); 3391 + return -EINVAL; 3392 + } 3393 + 3388 3394 if (!strcasecmp(argv[0], "create_thin")) 3389 3395 r = process_create_thin_mesg(argc, argv, pool); 3390 3396