Re: [dm-devel] [PATCH 07/20] init: refactor name_to_dev_t

2020-11-18 Thread Christoph Hellwig
On Wed, Nov 18, 2020 at 03:37:47PM +0100, Jan Kara wrote: > > -static inline dev_t blk_lookup_devt(const char *name, int partno) > > -{ > > - dev_t devt = MKDEV(0, 0); > > - return devt; > > -} > > #endif /* CONFIG_BLOCK */ > > This hunk looks unrelated to the change? Also why you move the de

Re: [dm-devel] [PATCH 08/20] init: refactor devt_from_partuuid

2020-11-18 Thread Jan Kara
On Wed 18-11-20 09:47:48, Christoph Hellwig wrote: > The code in devt_from_partuuid is very convoluted. Refactor a bit by > sanitizing the goto and variable name usage. > > Signed-off-by: Christoph Hellwig The patch looks good to me. You can add: Reviewed-by: Jan Kara

Re: [dm-devel] [PATCH 02/20] block: remove a duplicate __disk_get_part prototype

2020-11-18 Thread Jan Kara
On Wed 18-11-20 09:47:42, Christoph Hellwig wrote: > Signed-off-by: Christoph Hellwig Looks good. You can add: Reviewed-by: Jan Kara Honza > --- > include/linux/genhd.h | 1 - > 1 file changed, 1 deletion(-) > > diff --git a/in

Re: [dm-devel] [PATCH 09/20] init: cleanup match_dev_by_uuid and match_dev_by_label

2020-11-18 Thread Jan Kara
On Wed 18-11-20 09:47:49, Christoph Hellwig wrote: > Avoid a totally pointless goto label, and use the same style of > comparism for both helpers. > > Signed-off-by: Christoph Hellwig OK. You can add: Reviewed-by: Jan Kara Honza

Re: [dm-devel] [PATCH 10/20] block: refactor __blkdev_put

2020-11-18 Thread Jan Kara
On Wed 18-11-20 09:47:50, Christoph Hellwig wrote: > Reorder the code to have one big section for the last close, and to use > bdev_is_partition. > > Signed-off-by: Christoph Hellwig Looks good. You can add: Reviewed-by: Jan Kara

Re: [dm-devel] [PATCH 05/20] block: use put_device in put_disk

2020-11-18 Thread Jan Kara
On Wed 18-11-20 09:47:45, Christoph Hellwig wrote: > Use put_device to put the device instead of poking into the internals > and using kobject_put. > > Signed-off-by: Christoph Hellwig Looks good. You can add: Reviewed-by: Jan Kara

Re: [dm-devel] [PATCH 03/20] block: add a bdev_kobj helper

2020-11-18 Thread Jan Kara
On Wed 18-11-20 09:47:43, Christoph Hellwig wrote: > Add a little helper to find the kobject for a struct block_device. > > Signed-off-by: Christoph Hellwig Looks good. You can add: Reviewed-by: Jan Kara Honza > --- > drivers/m

Re: [dm-devel] [PATCH 06/20] block: change the hash used for looking up block devices

2020-11-18 Thread Jan Kara
On Wed 18-11-20 09:47:46, Christoph Hellwig wrote: > Adding the minor to the major creates tons of pointless conflicts. Just > use the dev_t itself, which is 32-bits and thus is guaranteed to fit > into ino_t. > > Signed-off-by: Christoph Hellwig Fair enough. You can add: Reviewed-by: Jan Kara

Re: [dm-devel] [PATCH 07/20] init: refactor name_to_dev_t

2020-11-18 Thread Jan Kara
On Wed 18-11-20 09:47:47, Christoph Hellwig wrote: > Split each case into a self-contained helper. > > Signed-off-by: Christoph Hellwig > --- > include/linux/genhd.h | 7 +- > init/do_mounts.c | 183 +- > 2 files changed, 91 insertions(+), 99 deleti

Re: [dm-devel] [PATCH 04/20] block: use disk_part_iter_exit in disk_part_iter_next

2020-11-18 Thread Jan Kara
On Wed 18-11-20 09:47:44, Christoph Hellwig wrote: > Call disk_part_iter_exit in disk_part_iter_next instead of duplicating > the functionality. > > Signed-off-by: Christoph Hellwig OK. You can add: Reviewed-by: Jan Kara Honza >

Re: [dm-devel] md: dm-writeback: add __noreturn to BUG-ging function

2020-11-18 Thread Mikulas Patocka
On Wed, 18 Nov 2020, Mike Snitzer wrote: > On Wed, Nov 18 2020 at 10:49am -0500, > Mike Snitzer wrote: > > > I don't think my suggestion will help.. given it'd still leave > > persistent_memory_claim() without a return statement. > > > > Think it worthwhile to just add a dummy 'return 0;' af

Re: [dm-devel] [PATCH 01/20] blk-cgroup: fix a hd_struct leak in blkcg_fill_root_iostats

2020-11-18 Thread Jan Kara
On Wed 18-11-20 09:47:41, Christoph Hellwig wrote: > disk_get_part needs to be paired with a disk_put_part. > > Fixes: ef45fe470e1 ("blk-cgroup: show global disk stats in root cgroup > io.stat") > Signed-off-by: Christoph Hellwig Looks good to me. You can add: Reviewed-by: Jan Kara

Re: [dm-devel] md: dm-writeback: add __noreturn to BUG-ging function

2020-11-18 Thread Randy Dunlap
On 11/18/20 8:35 AM, Christian Borntraeger wrote: > > > On 18.11.20 17:07, Mike Snitzer wrote: >> On Wed, Nov 18 2020 at 10:49am -0500, >> Mike Snitzer wrote: >> >>> I don't think my suggestion will help.. given it'd still leave >>> persistent_memory_claim() without a return statement. >>> >>> T

Re: [dm-devel] md: dm-writeback: add __noreturn to BUG-ging function

2020-11-18 Thread Christian Borntraeger
On 18.11.20 17:07, Mike Snitzer wrote: > On Wed, Nov 18 2020 at 10:49am -0500, > Mike Snitzer wrote: > >> I don't think my suggestion will help.. given it'd still leave >> persistent_memory_claim() without a return statement. >> >> Think it worthwhile to just add a dummy 'return 0;' after the

Re: [dm-devel] [PATCH 19/20] bcache: remove a superflous lookup_bdev all

2020-11-18 Thread Christoph Hellwig
On Wed, Nov 18, 2020 at 04:54:51PM +0800, Coly Li wrote: > On 11/18/20 4:47 PM, Christoph Hellwig wrote: > > Don't bother to call lookup_bdev for just a slightly different error > > message without any functional change. > > > > Signed-off-by: Christoph Hellwig ist > > Hi Christoph, > > NACK. Th

Re: [dm-devel] md: dm-writeback: add __noreturn to BUG-ging function

2020-11-18 Thread Mike Snitzer
On Wed, Nov 18 2020 at 10:49am -0500, Mike Snitzer wrote: > I don't think my suggestion will help.. given it'd still leave > persistent_memory_claim() without a return statement. > > Think it worthwhile to just add a dummy 'return 0;' after the BUG(). Decided to go with this, now staged for 5.1

Re: [dm-devel] md: dm-writeback: add __noreturn to BUG-ging function

2020-11-18 Thread Mike Snitzer
On Tue, Nov 17 2020 at 11:31am -0500, Mike Snitzer wrote: > On Mon, Nov 16 2020 at 6:00pm -0500, > Randy Dunlap wrote: > > > On 11/15/20 11:30 PM, Christian Borntraeger wrote: > > > > > > > > > On 13.11.20 23:52, Randy Dunlap wrote: > > >> Building on arch/s390/ flags this as an error, so ad

Re: [dm-devel] [PATCH v2] dm: add support for DM_TARGET_NOWAIT for various targets

2020-11-18 Thread Mike Snitzer
I just staged this for 5.11, see: https://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm.git/commit/?h=dm-5.11&id=373ce365b756bf6fec237461a0bbe65f33f201f6 I tweaked your patch header just a bit. Thanks, Mike On Tue, Nov 17 2020 at 9:01pm -0500, JeffleXu wrote: > Hi Mike, > >

Re: [dm-devel] merge struct block_device and struct hd_struct

2020-11-18 Thread Matthew Wilcox
On Wed, Nov 18, 2020 at 10:23:51AM +0100, Jan Beulich wrote: > On 18.11.2020 10:09, Greg KH wrote: > > On Wed, Nov 18, 2020 at 10:04:04AM +0100, Jan Beulich wrote: > >> On 18.11.2020 09:58, Christoph Hellwig wrote: > >>> On Wed, Nov 18, 2020 at 09:56:11AM +0100, Jan Beulich wrote: > since this

Re: [dm-devel] [PATCH 19/20] bcache: remove a superflous lookup_bdev all

2020-11-18 Thread Coly Li
On 11/18/20 5:10 PM, Greg KH wrote: > On Wed, Nov 18, 2020 at 04:54:51PM +0800, Coly Li wrote: >> On 11/18/20 4:47 PM, Christoph Hellwig wrote: >>> Don't bother to call lookup_bdev for just a slightly different error >>> message without any functional change. >>> >>> Signed-off-by: Christoph Hellwi

Re: [dm-devel] merge struct block_device and struct hd_struct

2020-11-18 Thread Greg KH
On Wed, Nov 18, 2020 at 10:23:51AM +0100, Jan Beulich wrote: > On 18.11.2020 10:09, Greg KH wrote: > > On Wed, Nov 18, 2020 at 10:04:04AM +0100, Jan Beulich wrote: > >> On 18.11.2020 09:58, Christoph Hellwig wrote: > >>> On Wed, Nov 18, 2020 at 09:56:11AM +0100, Jan Beulich wrote: > since this

Re: [dm-devel] merge struct block_device and struct hd_struct

2020-11-18 Thread Greg KH
On Wed, Nov 18, 2020 at 10:04:04AM +0100, Jan Beulich wrote: > On 18.11.2020 09:58, Christoph Hellwig wrote: > > On Wed, Nov 18, 2020 at 09:56:11AM +0100, Jan Beulich wrote: > >> since this isn't the first series from you recently spamming > >> xen-devel, may I ask that you don't Cc entire series t

Re: [dm-devel] merge struct block_device and struct hd_struct

2020-11-18 Thread Greg KH
On Wed, Nov 18, 2020 at 09:47:40AM +0100, Christoph Hellwig wrote: > Hi Jens, > > this series cleans up our main per-device node data structure by merging > the block_device and hd_struct data structures that have the same scope, > but different life times. The main effect (besides removing lots

Re: [dm-devel] [PATCH 19/20] bcache: remove a superflous lookup_bdev all

2020-11-18 Thread Coly Li
On 11/18/20 4:47 PM, Christoph Hellwig wrote: > Don't bother to call lookup_bdev for just a slightly different error > message without any functional change. > > Signed-off-by: Christoph Hellwig ist Hi Christoph, NACK. This removing error message is frequently triggered and observed, and distinc

Re: [dm-devel] [PATCH 19/20] bcache: remove a superflous lookup_bdev all

2020-11-18 Thread Greg KH
On Wed, Nov 18, 2020 at 04:54:51PM +0800, Coly Li wrote: > On 11/18/20 4:47 PM, Christoph Hellwig wrote: > > Don't bother to call lookup_bdev for just a slightly different error > > message without any functional change. > > > > Signed-off-by: Christoph Hellwig ist > > Hi Christoph, > > NACK. Th

Re: [dm-devel] merge struct block_device and struct hd_struct

2020-11-18 Thread Christoph Hellwig
On Wed, Nov 18, 2020 at 10:04:04AM +0100, Jan Beulich wrote: > That's the view of some people, but not all. Context can be easily > established by those who care going to one of the many archives on > which the entire series lands. Getting spammed, however, can't be > avoided by the dozens or hundr

Re: [dm-devel] merge struct block_device and struct hd_struct

2020-11-18 Thread Christoph Hellwig
On Wed, Nov 18, 2020 at 09:56:11AM +0100, Jan Beulich wrote: > since this isn't the first series from you recently spamming > xen-devel, may I ask that you don't Cc entire series to lists > which are involved with perhaps just one out of the many patches? > IMO Cc lists should be compiled on a per-

[dm-devel] [PATCH 12/20] block: simplify the block device claiming interface

2020-11-18 Thread Christoph Hellwig
Stop passing the whole device as a separate argument given that it can be trivially deducted. Signed-off-by: Christoph Hellwig --- drivers/block/loop.c | 12 +++- fs/block_dev.c | 69 +++--- include/linux/blkdev.h | 6 ++-- 3 files changed, 38 i

[dm-devel] [PATCH 15/20] block: merge struct block_device and struct hd_struct

2020-11-18 Thread Christoph Hellwig
Instead of having two structures that represent each block device with different lift time rules merged them into a single one. This also greatly simplifies the reference counting rules, as we can use the inode reference count as the main reference count for the new struct block_device, with the d

[dm-devel] [PATCH 13/20] block: remove ->bd_contains

2020-11-18 Thread Christoph Hellwig
Now that each hd_struct has a reference to the corresponding block_device, there is no need for the bd_contains pointer. Add a bdev_whole() helper to look up the whole device block_device struture instead. Signed-off-by: Christoph Hellwig --- drivers/scsi/scsicam.c| 2 +- fs/block_dev.c

[dm-devel] [PATCH 03/20] block: add a bdev_kobj helper

2020-11-18 Thread Christoph Hellwig
Add a little helper to find the kobject for a struct block_device. Signed-off-by: Christoph Hellwig --- drivers/md/bcache/super.c | 7 ++- drivers/md/md.c | 4 +--- fs/btrfs/sysfs.c | 15 +++ include/linux/blk_types.h | 3 +++ 4 files changed, 9 insertions(+

[dm-devel] [PATCH 16/20] block: stop using bdget_disk for partition 0

2020-11-18 Thread Christoph Hellwig
We can just dereference the point in struct gendisk instead. Also remove the now unused export. Signed-off-by: Christoph Hellwig --- block/genhd.c | 1 - drivers/block/nbd.c | 4 +--- drivers/block/xen-blkfront.c| 20 +--- drivers/block/zram/z

[dm-devel] [PATCH 06/20] block: change the hash used for looking up block devices

2020-11-18 Thread Christoph Hellwig
Adding the minor to the major creates tons of pointless conflicts. Just use the dev_t itself, which is 32-bits and thus is guaranteed to fit into ino_t. Signed-off-by: Christoph Hellwig --- fs/block_dev.c | 26 ++ 1 file changed, 2 insertions(+), 24 deletions(-) diff --g

[dm-devel] [PATCH 17/20] filemap: consistently use ->f_mapping over ->i_mapping

2020-11-18 Thread Christoph Hellwig
Use file->f_mapping in all remaining places that have a struct file available to properly handle the case where inode->i_mapping != file_inode(file)->i_mapping. Signed-off-by: Christoph Hellwig --- mm/filemap.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/mm/filem

[dm-devel] [PATCH 11/20] block: reference struct block_device from struct hd_struct

2020-11-18 Thread Christoph Hellwig
To simplify block device lookup and a few other upcomdin areas, make sure that we always have a struct block_device available for each disk and each partition. The only downside of this is that each device and partition uses a little more memories. The upside will be that a lot of code can be sim

[dm-devel] [PATCH 20/20] block: remove i_bdev

2020-11-18 Thread Christoph Hellwig
Switch the block device lookup interfaces to directly work with a dev_t so that struct block_device references are only acquired by the blkdev_get variants (and the blk-cgroup special case). This means that we not don't need an extra reference in the inode and can generally simplify handling of st

[dm-devel] [PATCH 02/20] block: remove a duplicate __disk_get_part prototype

2020-11-18 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig --- include/linux/genhd.h | 1 - 1 file changed, 1 deletion(-) diff --git a/include/linux/genhd.h b/include/linux/genhd.h index 46553d6d602563..22f5b9fd96f8bf 100644 --- a/include/linux/genhd.h +++ b/include/linux/genhd.h @@ -250,7 +250,6 @@ static inline dev_t p

[dm-devel] [PATCH 19/20] bcache: remove a superflous lookup_bdev all

2020-11-18 Thread Christoph Hellwig
Don't bother to call lookup_bdev for just a slightly different error message without any functional change. Signed-off-by: Christoph Hellwig --- drivers/md/bcache/super.c | 44 +-- 1 file changed, 1 insertion(+), 43 deletions(-) diff --git a/drivers/md/bcache

[dm-devel] [PATCH 04/20] block: use disk_part_iter_exit in disk_part_iter_next

2020-11-18 Thread Christoph Hellwig
Call disk_part_iter_exit in disk_part_iter_next instead of duplicating the functionality. Signed-off-by: Christoph Hellwig --- block/genhd.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/block/genhd.c b/block/genhd.c index 4e039524f92b8f..0bd9c41dd4cb69 100644 --- a/block

[dm-devel] [PATCH 01/20] blk-cgroup: fix a hd_struct leak in blkcg_fill_root_iostats

2020-11-18 Thread Christoph Hellwig
disk_get_part needs to be paired with a disk_put_part. Fixes: ef45fe470e1 ("blk-cgroup: show global disk stats in root cgroup io.stat") Signed-off-by: Christoph Hellwig --- block/blk-cgroup.c | 1 + 1 file changed, 1 insertion(+) diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c index c68bdf

[dm-devel] [PATCH 09/20] init: cleanup match_dev_by_uuid and match_dev_by_label

2020-11-18 Thread Christoph Hellwig
Avoid a totally pointless goto label, and use the same style of comparism for both helpers. Signed-off-by: Christoph Hellwig --- init/do_mounts.c | 18 ++ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/init/do_mounts.c b/init/do_mounts.c index afa26a4028d25e..5879

[dm-devel] [PATCH 07/20] init: refactor name_to_dev_t

2020-11-18 Thread Christoph Hellwig
Split each case into a self-contained helper. Signed-off-by: Christoph Hellwig --- include/linux/genhd.h | 7 +- init/do_mounts.c | 183 +- 2 files changed, 91 insertions(+), 99 deletions(-) diff --git a/include/linux/genhd.h b/include/linux/genhd.

[dm-devel] [PATCH 14/20] block: remove the nr_sects field in struct hd_struct

2020-11-18 Thread Christoph Hellwig
Now that the hd_struct always has a block device attached to it, there is no need for having two size field that just get out of sync. Additional the field in hd_struct did not use proper serializiation, possibly allowing for torn writes. By only using the block_device field this problem also get

[dm-devel] [PATCH 05/20] block: use put_device in put_disk

2020-11-18 Thread Christoph Hellwig
Use put_device to put the device instead of poking into the internals and using kobject_put. 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 0bd9c41dd4cb69..f46e89226fdf91 100644 --- a/bloc

[dm-devel] [PATCH 18/20] fs: remove get_super_thawed and get_super_exclusive_thawed

2020-11-18 Thread Christoph Hellwig
Just open code the wait in the only caller of both functions. Signed-off-by: Christoph Hellwig --- fs/internal.h | 2 ++ fs/quota/quota.c | 31 +--- fs/super.c | 51 ++ include/linux/fs.h | 4 +--- 4 files chang

[dm-devel] merge struct block_device and struct hd_struct

2020-11-18 Thread Christoph Hellwig
Hi Jens, this series cleans up our main per-device node data structure by merging the block_device and hd_struct data structures that have the same scope, but different life times. The main effect (besides removing lots of code) is that instead of having two device sizes that need complex synchro

[dm-devel] [PATCH 10/20] block: refactor __blkdev_put

2020-11-18 Thread Christoph Hellwig
Reorder the code to have one big section for the last close, and to use bdev_is_partition. Signed-off-by: Christoph Hellwig --- fs/block_dev.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/fs/block_dev.c b/fs/block_dev.c index 29db12c3bb501c..4c4d6c30382c06 1

[dm-devel] [PATCH 08/20] init: refactor devt_from_partuuid

2020-11-18 Thread Christoph Hellwig
The code in devt_from_partuuid is very convoluted. Refactor a bit by sanitizing the goto and variable name usage. Signed-off-by: Christoph Hellwig --- init/do_mounts.c | 68 ++-- 1 file changed, 31 insertions(+), 37 deletions(-) diff --git a/init/do_