[dm-devel] [PATCH 32/78] block: remove set_device_ro

2020-11-16 Thread Christoph Hellwig
Fold set_device_ro into its only remaining caller. Signed-off-by: Christoph Hellwig --- block/genhd.c | 7 --- block/ioctl.c | 2 +- include/linux/genhd.h | 1 - 3 files changed, 1 insertion(+), 9 deletions(-) diff --git a/block/genhd.c b/block/genhd.c index 8c350fecfe8bfe

[dm-devel] [PATCH 08/78] nbd: refactor size updates

2020-11-16 Thread Christoph Hellwig
Merge nbd_size_set and nbd_size_update into a single function that also updates the nbd_config fields. This new function takes the device size in bytes as the first argument, and the blocksize as the second argument, simplifying the calculations required in most callers. Signed-off-by: Christoph

[dm-devel] [PATCH 26/78] block: add a new set_read_only method

2020-11-16 Thread Christoph Hellwig
Add a new method to allow for driver-specific processing when setting or clearing the block device read-only state. This allows to replace the cumbersome and error-prone override of the whole ioctl implementation. Signed-off-by: Christoph Hellwig --- block/ioctl.c | 5 + include

[dm-devel] [PATCH 38/78] block: rework requesting modules for unclaimed devices

2020-11-16 Thread Christoph Hellwig
Instead of reusing the ranges in bdev_map, add a new helper that is called if no ranges was found. This is a first step to unpeel and eventually remove the complex ranges structure. Signed-off-by: Christoph Hellwig Reviewed-by: Hannes Reinecke --- block/genhd.c | 25

[dm-devel] [PATCH 07/78] nbd: move the task_recv check into nbd_size_update

2020-11-16 Thread Christoph Hellwig
nbd_size_update is about to acquire a few more callers, so lift the check into the function. Signed-off-by: Christoph Hellwig Reviewed-by: Josef Bacik --- drivers/block/nbd.c | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/block/nbd.c b/drivers/block

[dm-devel] [PATCH 37/78] block: split block_class_lock

2020-11-16 Thread Christoph Hellwig
Split the block_class_lock mutex into one each to protect bdev_map and major_names. Signed-off-by: Christoph Hellwig Reviewed-by: Hannes Reinecke --- block/genhd.c | 29 +++-- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/block/genhd.c b/block/genhd.c

[dm-devel] [PATCH 27/78] rbd: implement ->set_read_only to hook into BLKROSET processing

2020-11-16 Thread Christoph Hellwig
Implement the ->set_read_only method instead of parsing the actual ioctl command. Signed-off-by: Christoph Hellwig Acked-by: Ilya Dryomov --- drivers/block/rbd.c | 40 1 file changed, 4 insertions(+), 36 deletions(-) diff --git a/drivers/block/rbd.

[dm-devel] [PATCH 01/78] block: remove the call to __invalidate_device in check_disk_size_change

2020-11-16 Thread Christoph Hellwig
because so many people use partitions, for which no invalidation was performed anyway. Signed-off-by: Christoph Hellwig Reviewed-by: Hannes Reinecke --- fs/block_dev.c | 6 -- 1 file changed, 6 deletions(-) diff --git a/fs/block_dev.c b/fs/block_dev.c index 9e84b1928b9401..66ebf594c97f47 10

[dm-devel] [PATCH 04/78] sd: update the bdev size in sd_revalidate_disk

2020-11-16 Thread Christoph Hellwig
This avoids the extra call to revalidate_disk_size in sd_rescan and is otherwise a no-op because the size did not change, or we are in the probe path. Signed-off-by: Christoph Hellwig Acked-by: Martin K. Petersen Reviewed-by: Hannes Reinecke --- drivers/scsi/sd.c | 8 +++- 1 file changed

[dm-devel] [PATCH 22/78] virtio-blk: remove a spurious call to revalidate_disk_size

2020-11-16 Thread Christoph Hellwig
revalidate_disk_size just updates the block device size from the disk size. Thus calling it from virtblk_update_cache_mode doesn't actually do anything. Signed-off-by: Christoph Hellwig Acked-by: Stefan Hajnoczi Acked-by: Michael S. Tsirkin --- drivers/block/virtio_blk.c | 1 - 1

[dm-devel] misc struct block_device related driver cleanups

2020-11-16 Thread Christoph Hellwig
Hi Jens, Minchan and Mike, this series cleans up a few interactions of driver with struct block_device, in preparation for big changes to struct block_device that I plan to send soon. Diffstat: block/loop.c |3 - block/mtip32xx/mtip32xx.c | 15 block/mtip32xx/mtip32xx

[dm-devel] [PATCH 5/6] dm: simplify flush_bio initialization in __send_empty_flush

2020-11-16 Thread Christoph Hellwig
We don't really need the struct block_device to initialize a bio. So switch from using bio_set_dev to manually setting up bi_disk (bi_partno will always be zero and has been cleared by bio_init already). Signed-off-by: Christoph Hellwig --- drivers/md/dm.c | 12 +++- 1 file chang

[dm-devel] [PATCH 6/6] dm: remove the block_device reference in struct mapped_device

2020-11-16 Thread Christoph Hellwig
Get rid of the long-lasting struct block_device reference in struct mapped_device. The only remaining user is the freeze code, where we can trivially look up the block device at freeze time and release the reference at thaw time. Signed-off-by: Christoph Hellwig --- drivers/md/dm-core.h | 2

[dm-devel] [PATCH 3/6] zram: do not call set_blocksize

2020-11-16 Thread Christoph Hellwig
set_blocksize is used by file systems to use their preferred buffer cache block size. Block drivers should not set it. Signed-off-by: Christoph Hellwig --- drivers/block/zram/zram_drv.c | 11 +-- drivers/block/zram/zram_drv.h | 1 - 2 files changed, 1 insertion(+), 11 deletions

[dm-devel] [PATCH 2/6] zram: remove the claim mechanism

2020-11-16 Thread Christoph Hellwig
block device that is not open. Signed-off-by: Christoph Hellwig --- drivers/block/zram/zram_drv.c | 72 --- 1 file changed, 15 insertions(+), 57 deletions(-) diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c index 6d15d51cee2b7e

[dm-devel] [PATCH 4/6] loop: do not call set_blocksize

2020-11-16 Thread Christoph Hellwig
set_blocksize is used by file systems to use their preferred buffer cache block size. Block drivers should not set it. Signed-off-by: Christoph Hellwig --- drivers/block/loop.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/block/loop.c b/drivers/block/loop.c index

[dm-devel] [PATCH 1/6] mtip32xx: remove the call to fsync_bdev on removal

2020-11-16 Thread Christoph Hellwig
del_gendisk already calls fsync_bdev for every partition, no need to do this twice. Signed-off-by: Christoph Hellwig --- drivers/block/mtip32xx/mtip32xx.c | 15 --- drivers/block/mtip32xx/mtip32xx.h | 2 -- 2 files changed, 17 deletions(-) diff --git a/drivers/block/mtip32xx

Re: [dm-devel] misc struct block_device related driver cleanups

2020-11-17 Thread Christoph Hellwig
On Tue, Nov 17, 2020 at 10:46:29AM -0500, Mike Snitzer wrote: > On Mon, Nov 16 2020 at 4:20pm -0500, > Christoph Hellwig wrote: > > > Hi Jens, Minchan and Mike, > > > > this series cleans up a few interactions of driver with struct > > block_device, in prep

[dm-devel] [PATCH 14/78] nvme: use set_capacity_and_notify in nvme_set_queue_dying

2020-11-17 Thread Christoph Hellwig
Use the block layer helper to update both the disk and block device sizes. Contrary to the name no notification is sent in this case, as a size 0 is special cased. Signed-off-by: Christoph Hellwig Reviewed-by: Hannes Reinecke --- drivers/nvme/host/core.c | 13 + 1 file changed, 1

[dm-devel] [PATCH 12/78] dm: use set_capacity_and_notify

2020-11-17 Thread Christoph Hellwig
Use set_capacity_and_notify to set the size of both the disk and block device. This also gets the uevent notifications for the resize for free. Signed-off-by: Christoph Hellwig Reviewed-by: Hannes Reinecke --- drivers/md/dm.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git

[dm-devel] [PATCH 20/78] md: use set_capacity_and_notify

2020-11-17 Thread Christoph Hellwig
Use set_capacity_and_notify to set the size of both the disk and block device. This also gets the uevent notifications for the resize for free. Signed-off-by: Christoph Hellwig Acked-by: Song Liu --- drivers/md/md-cluster.c | 6 ++ drivers/md/md-linear.c | 3 +-- drivers/md/md.c

[dm-devel] [PATCH 05/78] block: remove the update_bdev parameter to set_capacity_revalidate_and_notify

2020-11-17 Thread Christoph Hellwig
The update_bdev argument is always set to true, so remove it. Also rename the function to the slighly less verbose set_capacity_and_notify, as propagating the disk size to the block device isn't really revalidation. Signed-off-by: Christoph Hellwig Reviewed-by: Hannes Reinecke Review

[dm-devel] [PATCH 15/78] drbd: use set_capacity_and_notify

2020-11-17 Thread Christoph Hellwig
Use set_capacity_and_notify to set the size of both the disk and block device. This also gets the uevent notifications for the resize for free. Signed-off-by: Christoph Hellwig --- drivers/block/drbd/drbd_main.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers

[dm-devel] [PATCH 03/78] nvme: let set_capacity_revalidate_and_notify update the bdev size

2020-11-17 Thread Christoph Hellwig
There is no good reason to call revalidate_disk_size separately. Signed-off-by: Christoph Hellwig Reviewed-by: Hannes Reinecke --- drivers/nvme/host/core.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index

[dm-devel] [PATCH 02/78] loop: let set_capacity_revalidate_and_notify update the bdev size

2020-11-17 Thread Christoph Hellwig
There is no good reason to call revalidate_disk_size separately. Signed-off-by: Christoph Hellwig Reviewed-by: Hannes Reinecke --- drivers/block/loop.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/block/loop.c b/drivers/block/loop.c index a58084c2ed7ceb

[dm-devel] [PATCH 10/78] nbd: use set_capacity_and_notify

2020-11-17 Thread Christoph Hellwig
Use set_capacity_and_notify to update the disk and block device sizes and send a RESIZE uevent to userspace. Note that blktests relies on uevents being sent also for updates that did not change the device size, so the explicit kobject_uevent remains for that case. Signed-off-by: Christoph

[dm-devel] [PATCH 18/78] zram: use set_capacity_and_notify

2020-11-17 Thread Christoph Hellwig
Use set_capacity_and_notify to set the size of both the disk and block device. This also gets the uevent notifications for the resize for free. Signed-off-by: Christoph Hellwig --- drivers/block/zram/zram_drv.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers

[dm-devel] [PATCH 16/78] rbd: use set_capacity_and_notify

2020-11-17 Thread Christoph Hellwig
Use set_capacity_and_notify to set the size of both the disk and block device. This also gets the uevent notifications for the resize for free. Signed-off-by: Christoph Hellwig Acked-by: Ilya Dryomov --- drivers/block/rbd.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a

[dm-devel] [PATCH 17/78] rnbd: use set_capacity_and_notify

2020-11-17 Thread Christoph Hellwig
Use set_capacity_and_notify to set the size of both the disk and block device. This also gets the uevent notifications for the resize for free. Signed-off-by: Christoph Hellwig Acked-by: Jack Wang --- drivers/block/rnbd/rnbd-clt.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff

[dm-devel] [PATCH 13/78] pktcdvd: use set_capacity_and_notify

2020-11-17 Thread Christoph Hellwig
Use set_capacity_and_notify to set the size of both the disk and block device. This also gets the uevent notifications for the resize for free. Signed-off-by: Christoph Hellwig --- drivers/block/pktcdvd.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/block

[dm-devel] [PATCH 19/78] dm-raid: use set_capacity_and_notify

2020-11-17 Thread Christoph Hellwig
Use set_capacity_and_notify to set the size of both the disk and block device. This also gets the uevent notifications for the resize for free. Signed-off-by: Christoph Hellwig Reviewed-by: Hannes Reinecke --- drivers/md/dm-raid.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff

[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

[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

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

2020-11-18 Thread Christoph Hellwig
gets fixed. Signed-off-by: Christoph Hellwig --- block/bio.c| 2 +- block/blk-core.c | 2 +- block/blk.h| 53 -- block/genhd.c | 34 +++--- block/partitions/core.c| 17

[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

[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

[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

[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

[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/drive

[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

[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-cgro

[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

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

2020-11-18 Thread Christoph Hellwig
ng of struct block_device to keep the lookups contained in the core block layer code. Signed-off-by: Christoph Hellwig --- block/ioctl.c| 3 +- drivers/block/loop.c | 8 +- drivers/md/dm-table.c| 9 +- driver

[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 -

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

2020-11-18 Thread Christoph Hellwig
: Christoph Hellwig --- block/blk-cgroup.c | 42 block/blk-iocost.c | 36 +++ block/blk.h| 2 +- block/genhd.c | 204 - block/partitions/core.c| 28 ++--- fs/block_dev.c | 123

[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

[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

[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 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 15/20] block: merge struct block_device and struct hd_struct

2020-11-18 Thread Christoph Hellwig
device model reference front ending it for device model interaction. The percpu refcount in struct hd_struct is entirely gone given that struct block_device must be opened and thus valid for the duration of the I/O. Signed-off-by: Christoph Hellwig --- block/bio.c| 6

[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

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-

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] [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

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 07/20] init: refactor name_to_dev_t

2020-11-20 Thread Christoph Hellwig
On Thu, Nov 19, 2020 at 09:25:05AM +0100, Jan Kara wrote: > OK, understood. Still it would seem more logical to leave blk_lookup_devt() > declaration inside #ifdef CONFIG_BLOCK and just delete the !CONFIG_BLOCK > definition (to make it clear we ever expect only users compiled when > CONFIG_BLOCK is

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

2020-11-20 Thread Christoph Hellwig
On Thu, Nov 19, 2020 at 10:41:57AM +0100, Jan Kara wrote: > > rcu_assign_pointer(ptbl->part[0], &disk->part0); > > @@ -1772,8 +1626,10 @@ struct gendisk *__alloc_disk_node(int minors, int > > node_id) > > * converted to make use of bd_mutex and sequence counters. > > */ > > hd_se

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

2020-11-20 Thread Christoph Hellwig
On Thu, Nov 19, 2020 at 11:32:53AM +0100, Jan Kara wrote: > > @@ -1521,7 +1510,7 @@ static int __blkdev_get(struct block_device *bdev, > > fmode_t mode, void *holder, > > if (bdev->bd_bdi == &noop_backing_dev_info) > > bdev->bd_bdi = bdi_get(disk->queue->backing_dev

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

2020-11-20 Thread Christoph Hellwig
On Thu, Nov 19, 2020 at 01:05:25PM +0100, Jan Kara wrote: > > @@ -613,7 +613,7 @@ void guard_bio_eod(struct bio *bio) > > rcu_read_lock(); > > part = __disk_get_part(bio->bi_disk, bio->bi_partno); > > if (part) > > - maxsector = part_nr_sects_read(part); > > + maxsec

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

2020-11-20 Thread Christoph Hellwig
On Thu, Nov 19, 2020 at 03:39:21PM +0100, Jan Kara wrote: > This patch is kind of difficult to review due to the size of mostly > mechanical changes mixed with not completely mechanical changes. Can we > perhaps split out the mechanical bits? E.g. the rq->part => rq->bdev > renaming is mechanical a

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

2020-11-20 Thread Christoph Hellwig
On Thu, Nov 19, 2020 at 03:13:16PM +, Matthew Wilcox wrote: > On Wed, Nov 18, 2020 at 09:47:57AM +0100, Christoph Hellwig wrote: > > @@ -2887,13 +2887,13 @@ EXPORT_SYMBOL(filemap_map_pages); > > vm_fault_t filemap_page_mkwrite(struct vm_fault *vmf) > > { > > st

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

2020-11-20 Thread Christoph Hellwig
On Fri, Nov 20, 2020 at 12:21:21PM +0100, Jan Kara wrote: > > > AFAICT bd_size_lock is pointless after these changes so we can just remove > > > it? > > > > I don't think it is, as reuqiring bd_mutex for size updates leads to > > rather awkward lock ordering problems. > > OK, let me ask different

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

2020-11-20 Thread Christoph Hellwig
On Fri, Nov 20, 2020 at 03:59:56PM +, Matthew Wilcox wrote: > > Exactly. In theory we could skip it for 64-bit, but as updating the > > size isn't a fast path, and struct block_device isn't super size critical > > I'd rather keep the same code for 32 vs 64-bit builds. > > Is it better to swit

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

2020-11-21 Thread Christoph Hellwig
On Fri, Nov 20, 2020 at 09:05:48PM +0100, Jan Kara wrote: > The code is already switched to it AFAICT (the lock is really only used in > the two places that write i_size). But the problem is that in theory two > i_size_write() calls can race in a way that the resulting stored i_size is a > mix of t

Re: [dm-devel] [PATCH V14 00/18] block: support multi-page bvec

2019-01-21 Thread Christoph Hellwig
On Mon, Jan 21, 2019 at 04:17:47PM +0800, Ming Lei wrote: > V14: > - drop patch(patch 4 in V13) for renaming bvec helpers, as suggested by > Jens > - use mp_bvec_* as multi-page bvec helper name WTF? Where is this coming from? mp is just a nightmare of a name, and I also didn't see

Re: [dm-devel] [PATCH V14 00/18] block: support multi-page bvec

2019-01-21 Thread Christoph Hellwig
On Mon, Jan 21, 2019 at 04:37:12PM +0800, Ming Lei wrote: > On Mon, Jan 21, 2019 at 09:22:46AM +0100, Christoph Hellwig wrote: > > On Mon, Jan 21, 2019 at 04:17:47PM +0800, Ming Lei wrote: > > > V14: > > > - drop patch(patch 4 in V13) for renaming bvec helpers,

Re: [dm-devel] block: Fix a WRITE SAME BUG_ON

2019-01-29 Thread Christoph Hellwig
On Mon, Jan 28, 2019 at 11:54:08PM -0500, Martin K. Petersen wrote: > That said, now that we have REQ_OP_WRITE_ZEROES (where the LBS is > irrelevant due to the payload being the ZERO_PAGE), it may be worthwhile > to remove REQ_OP_WRITE_SAME. I think drbd is the only user relying on a > non-zero pay

Re: [dm-devel] block: Fix a WRITE SAME BUG_ON

2019-01-31 Thread Christoph Hellwig
On Wed, Jan 30, 2019 at 09:08:50AM -0500, John Dorminy wrote: > (I use WRITE_SAME to fill devices with a particular pattern in order > to catch failures to initialize disk structures appropriately, > personally, but it's just for convenience/speed.) How do you use it? We don't have a user interfa

Re: [dm-devel] block: Fix a WRITE SAME BUG_ON

2019-01-31 Thread Christoph Hellwig
On Thu, Jan 31, 2019 at 02:41:52PM -0500, John Dorminy wrote: > > On Wed, Jan 30, 2019 at 09:08:50AM -0500, John Dorminy wrote: > > > (I use WRITE_SAME to fill devices with a particular pattern in order > > > to catch failures to initialize disk structures appropriately, > > > personally, but it's

Re: [dm-devel] block: Fix a WRITE SAME BUG_ON

2019-02-01 Thread Christoph Hellwig
On Fri, Feb 01, 2019 at 05:03:40PM +0100, Heinz Mauelshagen wrote: > On 2/1/19 3:09 PM, John Dorminy wrote: > > I didn't know such a thing existed... does it work on any block > > device? Where do I read more about this? > > > Use sg_write_same(8) from package sg3_utils. > > For instance 'sg_wri

Re: [dm-devel] [PATCH V15 00/18] block: support multi-page bvec

2019-02-15 Thread Christoph Hellwig
I still don't understand why mp_bvec_last_segment isn't simply called bvec_last_segment as there is no conflict. But I don't want to hold this series up on that as there only are two users left and we can always just fix it up later. -- dm-devel mailing list dm-devel@redhat.com https://www.redhat

Re: [dm-devel] [PATCH 1/3] list_bl: Add hlist_bl_add_before/behind helpers

2019-03-11 Thread Christoph Hellwig
On Thu, Feb 28, 2019 at 04:32:02PM -0500, Mike Snitzer wrote: > Hi Paul and Christoph, > > You've added your Signed-off-by to include/linux/list_bl.h commits in > the past. I'm not sure how this proposed patch should be handled. > > These new hlist_bl_add_{before,behind} changes are a prereq for

[dm-devel] [PATCH] dm-crypt: fix endianess annotations around org_sector_of_dmreq

2019-04-04 Thread Christoph Hellwig
The sector used here is a little endian value, so use the right type for it. Signed-off-by: Christoph Hellwig --- drivers/md/dm-crypt.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c index dd6565798778..692cddf3fe2a

Re: [dm-devel] [PATCH] dm-crypt: fix endianess annotations around org_sector_of_dmreq

2019-04-16 Thread Christoph Hellwig
ping? On Thu, Apr 04, 2019 at 06:33:34PM +0200, Christoph Hellwig wrote: > The sector used here is a little endian value, so use the right > type for it. > > Signed-off-by: Christoph Hellwig > --- > drivers/md/dm-crypt.c | 8 > 1 file changed, 4 insertions(+), 4 d

Re: [dm-devel] [patch V2 12/29] dma/debug: Simplify stracktrace retrieval

2019-04-19 Thread Christoph Hellwig
Please fix up the > 80 char line. Otherwise: Reviewed-by: Christoph Hellwig -- dm-devel mailing list dm-devel@redhat.com https://www.redhat.com/mailman/listinfo/dm-devel

Re: [PATCH V2 1/2] block: Fix a NULL pointer dereference in generic_make_request()

2019-05-21 Thread Christoph Hellwig
Looks good, Reviewed-by: Christoph Hellwig

Re: [dm-devel] [PATCH V2 2/2] md/raid0: Do not bypass blocking queue entered for raid0 bios

2019-05-21 Thread Christoph Hellwig
On Mon, May 20, 2019 at 07:09:11PM -0300, Guilherme G. Piccoli wrote: > No changes from V1, only rebased to v5.2-rc1. > Also, notice that if [1] gets merged before this patch, the > BIO_QUEUE_ENTERED flag will change to BIO_SPLITTED, so the (easy) conflict > will need to be worked. > > [1] > http

Re: [PATCH V2 2/2] md/raid0: Do not bypass blocking queue entered for raid0 bios

2019-05-21 Thread Christoph Hellwig
On Tue, May 21, 2019 at 11:10:05AM -0300, Guilherme Piccoli wrote: > Hi Christoph, thanks for looking into this. > You're right, this series fixes both issues. The problem I see though > is that it relies > on legacy IO path removal - for v5.0 and beyond, all fine. But > backporting that to > v4.17

Re: block: be more careful about status in __bio_chain_endio

2019-06-12 Thread Christoph Hellwig
On Tue, Jun 11, 2019 at 10:56:42PM -0400, John Dorminy wrote: > I believe the second of these might, but is not guaranteed to, > preserve the first error observed in a child; I believe if you want to > definitely save the first error you need an atomic. Is there any reason not to simply use a cmpx

Re: [PATCH V6 1/4] block: Allow mapping of vmalloc-ed buffers

2019-06-30 Thread Christoph Hellwig
Looks good, Reviewed-by: Christoph Hellwig

Re: [PATCH V6 2/4] block: Kill gfp_t argument of blkdev_report_zones()

2019-06-30 Thread Christoph Hellwig
Looks good, Reviewed-by: Christoph Hellwig

Re: [PATCH V6 4/4] block: Limit zone array allocation size

2019-06-30 Thread Christoph Hellwig
Looks good, Reviewed-by: Christoph Hellwig

Re: [PATCH V6 3/4] sd_zbc: Fix report zones buffer allocation

2019-06-30 Thread Christoph Hellwig
Looks good, Reviewed-by: Christoph Hellwig

Re: [dm-devel] [PATCH 1/1] kpartx: Use __kernel_daddr_t for solaris_x86_slice.s_start

2019-07-08 Thread Christoph Hellwig
> -//typedef int daddr_t; /* or long - check */ > - > struct solaris_x86_slice { > unsigned short s_tag; /* ID tag of partition */ > unsigned short s_flag; /* permission flags */ > - longs_start;/* start sector no of partition */

Re: [dm-devel] [PATCH 1/1] kpartx: Use __kernel_daddr_t for solaris_x86_slice.s_start

2019-07-09 Thread Christoph Hellwig
On Tue, Jul 09, 2019 at 10:02:05AM +0200, Petr Vorel wrote: > > > What this really should use is fixed size types. > If it's not specific to __kernel_daddr_t nor daddr_t ("The type of a disk > address") and long is sufficient for all platforms, that's even better. > > I'd be just for removing typ

Re: [dm-devel] [PATCH] sched: make struct task_struct::state 32-bit

2019-09-02 Thread Christoph Hellwig
On Tue, Sep 03, 2019 at 12:05:58AM +0300, Alexey Dobriyan wrote: > 32-bit accesses are shorter than 64-bit accesses on x86_64. > Nothing uses 64-bitness of ->state. > > Space savings are ~2KB on F30 kernel config. I guess we'd save even more when moving from a volatile to WRITE_ONCE/READ_ONCE..

Re: [dm-devel] [PATCH] dm: introduce DM_GET_TARGET_VERSION

2019-09-16 Thread Christoph Hellwig
On Mon, Sep 16, 2019 at 05:55:42AM -0400, Mikulas Patocka wrote: > This patch introduces a new ioctl DM_GET_TARGET_VERSION. It will load a > target that is specified in the "name" entry in the parameter structure > and return its version. > > This functionality is intended to be used by cryptsetup

Re: [dm-devel] [PATCH] dm: introduce DM_GET_TARGET_VERSION

2019-09-16 Thread Christoph Hellwig
On Mon, Sep 16, 2019 at 08:16:41PM +0200, Milan Broz wrote: > > So the main idea behind this was just use already existing functionality > in kernel DM, and provide simple user-friendly way to detect some > incompatibilites > more early. If detection is not there, we just fallback to the old way.

Re: [dm-devel] [PATCH 1/1] kpartx: Use __kernel_daddr_t for solaris_x86_slice.s_start

2019-10-07 Thread Christoph Hellwig
On Wed, Oct 02, 2019 at 08:05:09AM +0200, Petr Vorel wrote: > I tried to search in [1], with not much success, I don't know the original > name > of the struct and struct members are quite similar. Do you have a tip, where > it > could be or would you dare to search? No, I don't know Solaris ver

Re: [dm-devel] [PATCH 1/4] block: Enhance blk_revalidate_disk_zones()

2019-10-24 Thread Christoph Hellwig
> diff --git a/block/blk-zoned.c b/block/blk-zoned.c > index 4bc5f260248a..293891b7068a 100644 > --- a/block/blk-zoned.c > +++ b/block/blk-zoned.c > @@ -441,6 +441,57 @@ void blk_queue_free_zone_bitmaps(struct request_queue *q) > q->seq_zones_wlock = NULL; > } > > +/** > + * blk_check_zone

Re: [dm-devel] [PATCH 2/4] block: Simplify report zones execution

2019-10-24 Thread Christoph Hellwig
Looks good: Reviewed-by: Christoph Hellwig -- dm-devel mailing list dm-devel@redhat.com https://www.redhat.com/mailman/listinfo/dm-devel

Re: [dm-devel] [PATCH 4/4] block: Generically handle report zones buffer

2019-10-24 Thread Christoph Hellwig
On Thu, Oct 24, 2019 at 03:50:06PM +0900, Damien Le Moal wrote: > Instead of relying on a zoned block device driver to allocate a buffer > for every execution of a report zones command execution, rely on the > block layer use of the device zone report queue limits to allocate a > buffer and keep it

Re: [dm-devel] [PATCH 2/8] block: Simplify REQ_OP_ZONE_RESET_ALL handling

2019-11-07 Thread Christoph Hellwig
Looks good, Reviewed-by: Christoph Hellwig -- dm-devel mailing list dm-devel@redhat.com https://www.redhat.com/mailman/listinfo/dm-devel

Re: [dm-devel] [PATCH 1/8] block: Remove REQ_OP_ZONE_RESET plugging

2019-11-07 Thread Christoph Hellwig
Looks good, Reviewed-by: Christoph Hellwig -- dm-devel mailing list dm-devel@redhat.com https://www.redhat.com/mailman/listinfo/dm-devel

Re: [dm-devel] [PATCH 4/8] block: add zone open, close and finish operations

2019-11-07 Thread Christoph Hellwig
Looks good, Reviewed-by: Christoph Hellwig -- dm-devel mailing list dm-devel@redhat.com https://www.redhat.com/mailman/listinfo/dm-devel

Re: [dm-devel] [PATCH 6/8] scsi: sd_zbc: add zone open, close, and finish support

2019-11-07 Thread Christoph Hellwig
Looks good, Reviewed-by: Christoph Hellwig -- dm-devel mailing list dm-devel@redhat.com https://www.redhat.com/mailman/listinfo/dm-devel

Re: [dm-devel] [PATCH 5/8] block: add zone open, close and finish ioctl support

2019-11-07 Thread Christoph Hellwig
Looks good, Reviewed-by: Christoph Hellwig -- dm-devel mailing list dm-devel@redhat.com https://www.redhat.com/mailman/listinfo/dm-devel

Re: [dm-devel] [PATCH 7/8] dm: add zone open, close and finish support

2019-11-07 Thread Christoph Hellwig
Looks good, Reviewed-by: Christoph Hellwig -- dm-devel mailing list dm-devel@redhat.com https://www.redhat.com/mailman/listinfo/dm-devel

Re: [dm-devel] [PATCH 8/8] null_blk: add zone open, close, and finish support

2019-11-07 Thread Christoph Hellwig
Looks good, Reviewed-by: Christoph Hellwig -- dm-devel mailing list dm-devel@redhat.com https://www.redhat.com/mailman/listinfo/dm-devel

<    1   2   3   4   5   6   7   8   9   10   >