[dm-devel] [PATCH 5/9] block: use revalidate_disk_size in set_capacity_revalidate_and_notify

2020-09-02 Thread Christoph Hellwig
Only virtio_blk and xen-blkfront set the revalidate argument to true, and both do not implement the ->revalidate_disk method. So switch to the helper that just updates the size instead. Signed-off-by: Christoph Hellwig --- block/genhd.c | 7 +++ include/linux/genhd.h | 4 ++-- 2 fil

Re: [dm-devel] [PATCH 5/9] block: use revalidate_disk_size in set_capacity_revalidate_and_notify

2020-09-02 Thread Johannes Thumshirn
Looks good, Reviewed-by: Johannes Thumshirn -- dm-devel mailing list dm-devel@redhat.com https://www.redhat.com/mailman/listinfo/dm-devel

Re: [dm-devel] flood of "dm-X: error: dax access failed" due to 5.9 commit 231609785cbfb

2020-09-02 Thread Verma, Vishal L
On Thu, 2020-09-03 at 00:40 +0800, Coly Li wrote: > On 2020/9/3 00:04, Mike Snitzer wrote: > > 5.9 commit 231609785cbfb ("dax: print error message by pr_info() in > > __generic_fsdax_supported()") switched from pr_debug() to pr_info(). > > > > The justification in the commit header is really inade

Re: [dm-devel] [PATCH] block: make bio_crypt_clone() return an error code

2020-09-02 Thread linmiaohe
Satya Tangirala wrote: >On Tue, Sep 01, 2020 at 10:15:11PM -0700, Eric Biggers wrote: >> From: Eric Biggers >> >> Callers of bio_clone_fast() may use a gfp_mask that excludes >> GFP_DIRECT_RECLAIM. For example, map_request() uses GFP_ATOMIC. >> >> If this were to happen, the mempool_alloc() i

Re: [dm-devel] [PATCH 9/9] block: remove revalidate_disk()

2020-09-02 Thread Song Liu
On Tue, Sep 1, 2020 at 9:00 AM Christoph Hellwig wrote: > > Remove the now unused helper. > > Signed-off-by: Christoph Hellwig Acked-by: Song Liu -- dm-devel mailing list dm-devel@redhat.com https://www.redhat.com/mailman/listinfo/dm-devel

Re: [dm-devel] [PATCH 4/9] block: add a new revalidate_disk_size helper

2020-09-02 Thread Song Liu
On Tue, Sep 1, 2020 at 9:00 AM Christoph Hellwig wrote: > [...] > drivers/md/md-cluster.c | 6 ++--- > drivers/md/md-linear.c| 2 +- > drivers/md/md.c | 10 - For md bits: Acked-by: Song Liu [...] > > +/** > + * revalidate_disk_size - checks for disk size

[dm-devel] [PATCH 7/9] target/iblock: fix holder printing in iblock_show_configfs_dev_params

2020-09-02 Thread Christoph Hellwig
bd_contains is never NULL for an open block device. In addition ibd_bd is always set to a block device that was exclusively opened by the target code, so the holder is guranteed to be ib_dev as well. Signed-off-by: Christoph Hellwig --- drivers/target/target_core_iblock.c | 5 ++--- 1 file chan

[dm-devel] [PATCH 8/9] block: use bd_partno in bdevname

2020-09-02 Thread Christoph Hellwig
No need to go through the hd_struct to find the partition number. Signed-off-by: Christoph Hellwig --- block/genhd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/genhd.c b/block/genhd.c index 081f1039d9367f..771aa56b1a8c3d 100644 --- a/block/genhd.c +++ b/block/genhd

[dm-devel] [PATCH 3/9] md: compare bd_disk instead of bd_contains

2020-09-02 Thread Christoph Hellwig
To check for partitions of the same disk bd_contains works as well, but bd_disk is way more obvious. Signed-off-by: Christoph Hellwig --- drivers/md/md.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/md/md.c b/drivers/md/md.c index 9562ef598ae1f4..3f33562d10d

[dm-devel] [PATCH 4/9] md: don't detour through bd_contains for the gendisk

2020-09-02 Thread Christoph Hellwig
bd_disk is set on all block devices, including those for partitions. Signed-off-by: Christoph Hellwig --- drivers/md/md.c | 2 +- drivers/md/md.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/md/md.c b/drivers/md/md.c index 3f33562d10d6f5..5a0fd93769a70e 100644 -

[dm-devel] [PATCH 1/9] Documentation/hdio: fix up obscure bd_contains references

2020-09-02 Thread Christoph Hellwig
bd_contains is an implementation detail and should not be mentioned in a userspace API documentation. Signed-off-by: Christoph Hellwig --- Documentation/userspace-api/ioctl/hdio.rst | 24 +++--- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/Documentation/userspa

[dm-devel] [PATCH 5/9] drbd: don't detour through bd_contains for the gendisk

2020-09-02 Thread Christoph Hellwig
bd_disk is set on all block devices, including those for partitions. Signed-off-by: Christoph Hellwig --- drivers/block/drbd/drbd_receiver.c | 2 +- drivers/block/drbd/drbd_worker.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/block/drbd/drbd_receiver.c b/dri

[dm-devel] [PATCH 6/9] drbd: don't set ->bd_contains

2020-09-02 Thread Christoph Hellwig
The ->bd_contains field is set by __blkdev_get and drivers have no business manipulating it. Signed-off-by: Christoph Hellwig --- drivers/block/drbd/drbd_main.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c index 04b6bde9419d

[dm-devel] [PATCH 9/9] vsprintf: use bd_partno in bdev_name

2020-09-02 Thread Christoph Hellwig
No need to go through the hd_struct to find the partition number. Signed-off-by: Christoph Hellwig --- lib/vsprintf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/vsprintf.c b/lib/vsprintf.c index afb9521ddf9197..14c9a6af1b239a 100644 --- a/lib/vsprintf.c +++ b/lib

[dm-devel] [PATCH 2/9] block: add a bdev_is_partition helper

2020-09-02 Thread Christoph Hellwig
Add a littler helper to make the somewhat arcane bd_contains checks a little more obvious. Signed-off-by: Christoph Hellwig --- block/blk-lib.c | 2 +- block/ioctl.c | 4 ++-- block/scsi_ioctl.c | 2 +- drivers/ide/ide-ioctls.c| 4 ++-- driv

[dm-devel] clean up is partition checks

2020-09-02 Thread Christoph Hellwig
Hi Jens, this series add a new helepr to check if a struct block_device represents a parition, and removes most direct access to ->bd_contained from drivers. Diffstat: Documentation/userspace-api/ioctl/hdio.rst | 24 block/blk-lib.c|2 +-

Re: [dm-devel] flood of "dm-X: error: dax access failed" due to 5.9 commit 231609785cbfb

2020-09-02 Thread Coly Li
On 2020/9/3 00:51, Mike Snitzer wrote: > On Wed, Sep 02 2020 at 12:46pm -0400, > Coly Li wrote: > >> On 2020/9/3 00:44, Mike Snitzer wrote: >>> On Wed, Sep 02 2020 at 12:40pm -0400, >>> Coly Li wrote: >>> On 2020/9/3 00:04, Mike Snitzer wrote: > 5.9 commit 231609785cbfb ("dax: print err

Re: [dm-devel] flood of "dm-X: error: dax access failed" due to 5.9 commit 231609785cbfb

2020-09-02 Thread Coly Li
On 2020/9/3 07:05, Verma, Vishal L wrote: > On Thu, 2020-09-03 at 00:40 +0800, Coly Li wrote: >> On 2020/9/3 00:04, Mike Snitzer wrote: >>> 5.9 commit 231609785cbfb ("dax: print error message by pr_info() in >>> __generic_fsdax_supported()") switched from pr_debug() to pr_info(). >>> >>> The justif

Re: [dm-devel] [git pull] device mapper fixes for 5.9-rc4

2020-09-02 Thread pr-tracker-bot
The pull request you sent on Wed, 2 Sep 2020 14:02:48 -0400: > git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm.git > tags/for-5.9/dm-fixes has been merged into torvalds/linux.git: https://git.kernel.org/torvalds/c/c3a1309564d3834bad6547a50e58bd195ee85fb6 Thank you! -- Dee

[dm-devel] [git pull] device mapper fixes for 5.9-rc4

2020-09-02 Thread Mike Snitzer
Hi Linus, The following changes since commit f75aef392f869018f78cfedf3c320a6b3fcfda6b: Linux 5.9-rc3 (2020-08-30 16:01:54 -0700) are available in the Git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm.git tags/for-5.9/dm-fixes for you to fetch changes

Re: [dm-devel] flood of "dm-X: error: dax access failed" due to 5.9 commit 231609785cbfb

2020-09-02 Thread Coly Li
On 2020/9/3 00:51, Mike Snitzer wrote: > On Wed, Sep 02 2020 at 12:46pm -0400, > Coly Li wrote: > >> On 2020/9/3 00:44, Mike Snitzer wrote: >>> On Wed, Sep 02 2020 at 12:40pm -0400, >>> Coly Li wrote: >>> On 2020/9/3 00:04, Mike Snitzer wrote: > 5.9 commit 231609785cbfb ("dax: print err

Re: [dm-devel] flood of "dm-X: error: dax access failed" due to 5.9 commit 231609785cbfb

2020-09-02 Thread Mike Snitzer
On Wed, Sep 02 2020 at 12:46pm -0400, Coly Li wrote: > On 2020/9/3 00:44, Mike Snitzer wrote: > > On Wed, Sep 02 2020 at 12:40pm -0400, > > Coly Li wrote: > > > >> On 2020/9/3 00:04, Mike Snitzer wrote: > >>> 5.9 commit 231609785cbfb ("dax: print error message by pr_info() in > >>> __generic_fs

Re: [dm-devel] flood of "dm-X: error: dax access failed" due to 5.9 commit 231609785cbfb

2020-09-02 Thread Coly Li
On 2020/9/3 00:44, Mike Snitzer wrote: > On Wed, Sep 02 2020 at 12:40pm -0400, > Coly Li wrote: > >> On 2020/9/3 00:04, Mike Snitzer wrote: >>> 5.9 commit 231609785cbfb ("dax: print error message by pr_info() in >>> __generic_fsdax_supported()") switched from pr_debug() to pr_info(). >>> >>> The

Re: [dm-devel] flood of "dm-X: error: dax access failed" due to 5.9 commit 231609785cbfb

2020-09-02 Thread Mike Snitzer
On Wed, Sep 02 2020 at 12:40pm -0400, Coly Li wrote: > On 2020/9/3 00:04, Mike Snitzer wrote: > > 5.9 commit 231609785cbfb ("dax: print error message by pr_info() in > > __generic_fsdax_supported()") switched from pr_debug() to pr_info(). > > > > The justification in the commit header is really

Re: [dm-devel] flood of "dm-X: error: dax access failed" due to 5.9 commit 231609785cbfb

2020-09-02 Thread Coly Li
On 2020/9/3 00:04, Mike Snitzer wrote: > 5.9 commit 231609785cbfb ("dax: print error message by pr_info() in > __generic_fsdax_supported()") switched from pr_debug() to pr_info(). > > The justification in the commit header is really inadequate. If there > is a problem that you need to drill in on

Re: [dm-devel] [PATCH 06/14] block: lift setting the readahead size into the block layer

2020-09-02 Thread Mike Snitzer
On Wed, Sep 02 2020 at 11:11am -0400, Christoph Hellwig wrote: > On Wed, Aug 26, 2020 at 06:07:38PM -0400, Mike Snitzer wrote: > > On Sun, Jul 26 2020 at 11:03am -0400, > > Christoph Hellwig wrote: > > > > > Drivers shouldn't really mess with the readahead size, as that is a VM > > > concept.

[dm-devel] flood of "dm-X: error: dax access failed" due to 5.9 commit 231609785cbfb

2020-09-02 Thread Mike Snitzer
5.9 commit 231609785cbfb ("dax: print error message by pr_info() in __generic_fsdax_supported()") switched from pr_debug() to pr_info(). The justification in the commit header is really inadequate. If there is a problem that you need to drill in on, repeat the testing after enabling the dynamic d

Re: [dm-devel] [PATCH 06/14] block: lift setting the readahead size into the block layer

2020-09-02 Thread Christoph Hellwig
On Wed, Aug 26, 2020 at 06:07:38PM -0400, Mike Snitzer wrote: > On Sun, Jul 26 2020 at 11:03am -0400, > Christoph Hellwig wrote: > > > Drivers shouldn't really mess with the readahead size, as that is a VM > > concept. Instead set it based on the optimal I/O size by lifting the > > algorithm fro

Re: [dm-devel] remove revalidate_disk()

2020-09-02 Thread Jens Axboe
On 9/1/20 9:57 AM, Christoph Hellwig wrote: > Hi Jens, > > this series removes the revalidate_disk() function, which has been a > really odd duck in the last years. The prime reason why most people > use it is because it propagates a size change from the gendisk to > the block_device structure.

[dm-devel] [PATCH 14/14] multipathpersist: delete unused variable in handle_args

2020-09-02 Thread lixiaokeng
In handle_args, the tmp isn't used. We delete it. Signed-off-by: Lixiaokeng Signed-off-by: Zhiqiang Liu Signed-off-by: Linfeilong --- mpathpersist/main.c | 1 - 1 file changed, 1 deletion(-) diff --git a/mpathpersist/main.c b/mpathpersist/main.c index f20c902c..ccf0024e 100644 --- a/mpathpers

[dm-devel] [PATCH 13/14] multipath: use update_multipath_table/status in, check_useable_paths

2020-09-02 Thread lixiaokeng
The return values of dm_get_map, disassemble_map,dm_get_status and disassemble_status in check_usable_paths were not checked. Use update_multipath_table/status to instead of them. Signed-off-by: Lixiaokeng Signed-off-by: Zhiqiang Liu Signed-off-by: Linfeilong --- multipath/main.c | 9 +++--

[dm-devel] [PATCH 12/14] libmultipathpersist: use update_multipath_table/status, in get_mpvec

2020-09-02 Thread lixiaokeng
The return values of dm_get_map, disassemble_map in get_mpvec were not checked. Use update_multipath_table/status to instead of them. Signed-off-by: Lixiaokeng Signed-off-by: Zhiqiang Liu Signed-off-by: Linfeilong --- libmpathpersist/mpath_persist.c | 11 +++ 1 file changed, 3 insertio

Re: [dm-devel] [PATCH 9/9] block: remove revalidate_disk()

2020-09-02 Thread Johannes Thumshirn
Looks good, Reviewed-by: Johannes Thumshirn -- dm-devel mailing list dm-devel@redhat.com https://www.redhat.com/mailman/listinfo/dm-devel

Re: [dm-devel] [PATCH 4/9] block: add a new revalidate_disk_size helper

2020-09-02 Thread Johannes Thumshirn
Looks good, Reviewed-by: Johannes Thumshirn -- dm-devel mailing list dm-devel@redhat.com https://www.redhat.com/mailman/listinfo/dm-devel

Re: [dm-devel] [PATCH 3/9] block: rename bd_invalidated

2020-09-02 Thread Johannes Thumshirn
Looks good, Reviewed-by: Johannes Thumshirn -- dm-devel mailing list dm-devel@redhat.com https://www.redhat.com/mailman/listinfo/dm-devel

Re: [dm-devel] [PATCH 1/9] Documentation/filesystems/locking.rst: remove an incorrect sentence

2020-09-02 Thread Johannes Thumshirn
Looks good, Reviewed-by: Johannes Thumshirn -- dm-devel mailing list dm-devel@redhat.com https://www.redhat.com/mailman/listinfo/dm-devel

Re: [dm-devel] [PATCH 7/9] sd: open code revalidate_disk

2020-09-02 Thread Johannes Thumshirn
Looks good, Reviewed-by: Johannes Thumshirn -- dm-devel mailing list dm-devel@redhat.com https://www.redhat.com/mailman/listinfo/dm-devel

[dm-devel] [PATCH 11/14] mpathpersist: check whether malloc paramp->trnptid_list, fails in handle_args func

2020-09-02 Thread lixiaokeng
In handle_args func, we donot check whether malloc paramp and each paramp->trnptid_list[j] fails before using them, it may cause access NULL pointer. Here, we add alloc_prout_param_descriptor to allocate and init paramp, and we add free_prout_param_descriptor to free paramp and each paramp->trnpti

Re: [dm-devel] [PATCH 6/9] nvme: opencode revalidate_disk in nvme_validate_ns

2020-09-02 Thread Johannes Thumshirn
Looks good, Reviewed-by: Johannes Thumshirn -- dm-devel mailing list dm-devel@redhat.com https://www.redhat.com/mailman/listinfo/dm-devel

[dm-devel] [PATCH 10/14] util/tests: use assert_non_null to ensure malloc, returns non-null pointer

2020-09-02 Thread lixiaokeng
In tests/util.c, we should use assert_non_null to ensure malloc() returns non-null pointer in both test_strlcpy_5 and test_strlcpy_6 func. Signed-off-by: Zhiqiang Liu Signed-off-by: lixiaokeng Signed-off-by: Linfeilong --- tests/util.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test

[dm-devel] [PATCH 09/14] libmultipath: check whether mp->features is NULl in, assemble_map

2020-09-02 Thread lixiaokeng
In assemble_map func, if add_feature fails and mp->features is default value (NULL), STRDUP(mp->features) will cause a seg-fault. In addition, f = STRDUP(mp->features) is just used for APPEND(). We can directly pass mp->features to APPEND(). Here, we firstly check whether mp->features is null. Si

[dm-devel] [PATCH 08/14] libmultipath: donot free *dst if REALLOC fails in, merge_words

2020-09-02 Thread lixiaokeng
In merge_words func, if REALLOC() fails, the input *dst will be freed. If so, mpp->hwhandler| mpp->features|mpp->selector may be set to NULL after calling merge_words func in disassemble_map func. This may cause accessing freed memory problem. Here, we donot free *dst if REALLOC() fails in merge_w

[dm-devel] [PATCH 07/14] libmultipath: check return value of dm_mapname in, sysfs_check_holders

2020-09-02 Thread lixiaokeng
In sysfs_check_holders func, table_name is obtained by calling dm_mapname func, and then call dm_reassign_table for reassigning table. However, we donnot check whether dm_mapname func returns NULL, and then it may cause a segmentation fault in dm_task_set_name. Here, we will check whether dm_mapna

[dm-devel] [PATCH 06/14] kpartx: check return value of malloc in main func

2020-09-02 Thread lixiaokeng
In main func of kpartx.c, we should check return value of malloc before using it. Signed-off-by: Zhiqiang Liu Signed-off-by: Lixiaokeng --- kpartx/kpartx.c | 4 1 file changed, 4 insertions(+) diff --git a/kpartx/kpartx.c b/kpartx/kpartx.c index 98f6176e..2f6dea7c 100644 --- a/kpartx/kpar

[dm-devel] [PATCH 05/14] multipathd: use MALLOC and check return value in, cli_getprkey func

2020-09-02 Thread lixiaokeng
In cli_getprkey func, we use MALLOC instead of malloc, and check the return value of MALLOC. Signed-off-by: Zhiqiang Liu Signed-off-by: Lixiaokeng Signed-off-by: Linfeilong --- multipathd/cli_handlers.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/multipathd/cli_han

[dm-devel] [PATCH 03/14] libmultipath: use map instead of dm_task_get_name

2020-09-02 Thread lixiaokeng
In dm_mapname, dm_task_get_name(dmt) has been called and the return value has been stored in map. Use map instead of second dm_task_get_name. Signed-off-by: Lixiaokeng Signed-off-by: Zhiqiang Liu Signed-off-by: Linfeilong --- libmultipath/devmapper.c | 2 +- 1 file changed, 1 insertion(+), 1

[dm-devel] [PATCH 04/14] multipathd: check MALLOC return value in, mpath_pr_event_handler_fn

2020-09-02 Thread lixiaokeng
In mpath_pr_event_handler_fn, we use MALLOC instead of malloc, and check the return value of MALLOC. Signed-off-by: Lixiaokeng Signed-off-by: Zhiqiang Liu Signed-off-by: Linfeilong --- multipathd/main.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/multipathd/mai

[dm-devel] [PATCH 02/14] libmultipath: check malloc return value in, print_foreign_topology

2020-09-02 Thread lixiaokeng
We check the return value of malloc in print_foreign_topology. Signed-off-by: Lixiaokeng Signed-off-by: Zhiqiang Liu Signed-off-by: Linfeilong --- libmultipath/foreign.c | 4 1 file changed, 4 insertions(+) diff --git a/libmultipath/foreign.c b/libmultipath/foreign.c index e8f61351..44f3

[dm-devel] [PATCH 01/14] multipathd: return if dm_get_major_minor failed in, cli_add_map

2020-09-02 Thread lixiaokeng
If dm_get_major_minor failed, log with major and minor should not be printed to avoid major and minor used before initialization. Signed-off-by: Lixiaokeng Signed-off-by: Zhiqiang Liu Signed-off-by: Linfeilong --- multipathd/cli_handlers.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletion