Re: [dm-devel] [PATCH 1/9] scsi/sd: add error handling support for add_disk()

2021-10-18 Thread Martin K. Petersen
Luis, > Thanks, would you like Jens to pick this up and the other scsi/sr patch > or are you taking it through your tree? Didn't think I had the relevant add_disk() patch in my baseline tree but it turns out I do. So I queued them up. Thanks! -- Martin K. Petersen Oracle Linux

Re: [dm-devel] don't use ->bd_inode to access the block device size v3

2021-10-18 Thread Jens Axboe
On 10/18/21 7:04 PM, Kari Argillander wrote: > On Mon, Oct 18, 2021 at 11:53:08AM -0600, Jens Axboe wrote: > > snip.. > >> diff --git a/include/linux/genhd.h b/include/linux/genhd.h >> index 7b0326661a1e..a967b3fb3c71 100644 >> --- a/include/linux/genhd.h >> +++ b/include/linux/genhd.h >> @@

Re: [dm-devel] [PATCH 1/9] scsi/sd: add error handling support for add_disk()

2021-10-18 Thread Luis Chamberlain
On Sat, Oct 16, 2021 at 10:51:48PM -0400, Martin K. Petersen wrote: > > Luis, > > > We never checked for errors on add_disk() as this function returned > > void. Now that this is fixed, use the shiny new error handling. > > > > As with the error handling for device_add() we follow the same logic

Re: [dm-devel] [PATCH v6 0/4] blk-crypto cleanups

2021-10-18 Thread Eric Biggers
On Mon, Oct 18, 2021 at 11:04:49AM -0700, Eric Biggers wrote: > > This series applies to block/for-next. > > Changed v5 => v6: > - Rebased onto block/for-next yet again > - Added more Reviewed-by tags > > Changed v4 => v5: > - Rebased onto block/for-next again > - Added Reviewed-by tags

[dm-devel] [PATCH v6 2/4] blk-crypto: rename keyslot-manager files to blk-crypto-profile

2021-10-18 Thread Eric Biggers
From: Eric Biggers In preparation for renaming struct blk_keyslot_manager to struct blk_crypto_profile, rename the keyslot-manager.h and keyslot-manager.c source files. Renaming these files separately before making a lot of changes to their contents makes it easier for git to understand that

[dm-devel] [PATCH v6 3/4] blk-crypto: rename blk_keyslot_manager to blk_crypto_profile

2021-10-18 Thread Eric Biggers
From: Eric Biggers blk_keyslot_manager is misnamed because it doesn't necessarily manage keyslots. It actually does several different things: - Contains the crypto capabilities of the device. - Provides functions to control the inline encryption hardware. Originally these were just

[dm-devel] [PATCH v6 0/4] blk-crypto cleanups

2021-10-18 Thread Eric Biggers
This series renames struct blk_keyslot_manager to struct blk_crypto_profile, as it is misnamed; it doesn't always manage keyslots. It's much more logical to think of it as the "blk-crypto profile" of a device, similar to blk_integrity_profile. This series also improves the inline-encryption.rst

[dm-devel] [PATCH v6 4/4] blk-crypto: update inline encryption documentation

2021-10-18 Thread Eric Biggers
From: Eric Biggers Rework most of inline-encryption.rst to be easier to follow, to correct some information, to add some important details and remove some unimportant details, and to take into account the renaming from blk_keyslot_manager to blk_crypto_profile. Reviewed-by: Mike Snitzer

[dm-devel] [PATCH v6 1/4] blk-crypto-fallback: properly prefix function and struct names

2021-10-18 Thread Eric Biggers
From: Eric Biggers For clarity, avoid using just the "blk_crypto_" prefix for functions and structs that are specific to blk-crypto-fallback. Instead, use "blk_crypto_fallback_". Some places already did this, but others didn't. This is also a prerequisite for using "struct blk_crypto_keyslot"

Re: [dm-devel] don't use ->bd_inode to access the block device size v3

2021-10-18 Thread Christoph Hellwig
Looks good, Reviewed-by: Christoph Hellwig -- dm-devel mailing list dm-devel@redhat.com https://listman.redhat.com/mailman/listinfo/dm-devel

Re: [dm-devel] don't use ->bd_inode to access the block device size v3

2021-10-18 Thread Jens Axboe
On 10/18/21 11:49 AM, Christoph Hellwig wrote: > On Mon, Oct 18, 2021 at 11:40:51AM -0600, Jens Axboe wrote: >> static inline loff_t bdev_nr_bytes(struct block_device *bdev) >> { >> -return i_size_read(bdev->bd_inode); >> +return bdev->bd_nr_sectors; > > This hunk needs to go into

Re: [dm-devel] don't use ->bd_inode to access the block device size v3

2021-10-18 Thread Christoph Hellwig
On Mon, Oct 18, 2021 at 11:40:51AM -0600, Jens Axboe wrote: > static inline loff_t bdev_nr_bytes(struct block_device *bdev) > { > - return i_size_read(bdev->bd_inode); > + return bdev->bd_nr_sectors; This hunk needs to go into bdev_nr_sectors, and the bdev_nr_bytes probably wants to

Re: [dm-devel] don't use ->bd_inode to access the block device size v3

2021-10-18 Thread Jens Axboe
On Mon, 18 Oct 2021 12:11:00 +0200, Christoph Hellwig wrote: > various drivers currently poke directy at the block device inode, which > is a bit of a mess. This series cleans up the places that read the > block device size to use the proper helpers. I have separate patches > for many of the

Re: [dm-devel] don't use ->bd_inode to access the block device size v3

2021-10-18 Thread Jens Axboe
On 10/18/21 11:18 AM, Christoph Hellwig wrote: > On Mon, Oct 18, 2021 at 11:16:08AM -0600, Jens Axboe wrote: >> This looks good to me. Followup question, as it's related - I've got a >> hacky patch that caches the inode size in the bdev: >> >>

Re: [dm-devel] don't use ->bd_inode to access the block device size v3

2021-10-18 Thread Christoph Hellwig
On Mon, Oct 18, 2021 at 11:16:08AM -0600, Jens Axboe wrote: > This looks good to me. Followup question, as it's related - I've got a > hacky patch that caches the inode size in the bdev: > > https://git.kernel.dk/cgit/linux-block/commit/?h=perf-wip=c754951eb7193258c35a574bd1b7c4946ee4 > > so

Re: [dm-devel] don't use ->bd_inode to access the block device size v3

2021-10-18 Thread Jens Axboe
On 10/18/21 4:11 AM, Christoph Hellwig wrote: > Hi Jens, > > various drivers currently poke directy at the block device inode, which > is a bit of a mess. This series cleans up the places that read the > block device size to use the proper helpers. I have separate patches > for many of the

Re: [PATCH 06/11] xfs: factor out a xfs_setup_dax helper

2021-10-18 Thread Darrick J. Wong
On Mon, Oct 18, 2021 at 06:40:49AM +0200, Christoph Hellwig wrote: > Factor out another DAX setup helper to simplify future changes. Also > move the experimental warning after the checks to not clutter the log > too much if the setup failed. > > Signed-off-by: Christoph Hellwig > --- >

Re: [PATCH 07/11] dax: remove dax_capable

2021-10-18 Thread Gao Xiang
On Mon, Oct 18, 2021 at 06:40:50AM +0200, Christoph Hellwig wrote: > Just open code the block size and dax_dev == NULL checks in the callers. > > Signed-off-by: Christoph Hellwig > --- > drivers/dax/super.c | 36 > drivers/md/dm-table.c| 22

Re: [dm-devel] [PATCH 11/30] affs: use bdev_nr_sectors instead of open coding it

2021-10-18 Thread Chaitanya Kulkarni
On 10/15/21 06:26, Christoph Hellwig wrote: > Use the proper helper to read the block device size. > > Signed-off-by: Christoph Hellwig > Reviewed-by: Kees Cook Looks good. Reviewed-by: Chaitanya Kulkarni -- dm-devel mailing list dm-devel@redhat.com

Re: [dm-devel] [PATCH 03/30] bcache: remove bdev_sectors

2021-10-18 Thread Chaitanya Kulkarni
On 10/15/21 06:26, Christoph Hellwig wrote: > Use the equivalent block layer helper instead. > > Signed-off-by: Christoph Hellwig > Reviewed-by: Kees Cook > Acked-by: Coly Li > --- Looks good. Reviewed-by: Chaitanya Kulkarni -- dm-devel mailing list dm-devel@redhat.com

Re: [dm-devel] [PATCH 25/30] block: add a sb_bdev_nr_blocks helper

2021-10-18 Thread Chaitanya Kulkarni
On 10/15/21 06:26, Christoph Hellwig wrote: > Add a helper to return the size of sb->s_bdev in sb->s_blocksize_bits > based unites. Note that SECTOR_SHIFT has to be open coded due to > include dependency issues for now, but I have a plan to sort that out > eventually. > > Signed-off-by:

Re: [dm-devel] [PATCH 22/30] reiserfs: use bdev_nr_bytes instead of open coding it

2021-10-18 Thread Chaitanya Kulkarni
On 10/15/21 06:26, Christoph Hellwig wrote: > Use the proper helper to read the block device size and remove two > cargo culted checks that can't be false. > > Signed-off-by: Christoph Hellwig > Reviewed-by: Jan Kara Looks good. Reviewed-by: Chaitanya Kulkarni -- dm-devel mailing list

Re: [dm-devel] [PATCH 26/30] ext4: use sb_bdev_nr_blocks

2021-10-18 Thread Chaitanya Kulkarni
On 10/15/21 06:26, Christoph Hellwig wrote: > Use the sb_bdev_nr_blocks helper instead of open coding it. > > Signed-off-by: Christoph Hellwig > Reviewed-by: Kees Cook > Reviewed-by: Jan Kara > Acked-by: Theodore Ts'o > Looks good. Reviewed-by: Chaitanya Kulkarni -- dm-devel mailing

Re: [dm-devel] [PATCH 01/30] block: move the SECTOR_SIZE related definitions to blk_types.h

2021-10-18 Thread Chaitanya Kulkarni
On 10/15/21 06:26, Christoph Hellwig wrote: > Ensure these are always available for inlines in the various block layer > headers. > > Signed-off-by: Christoph Hellwig Looks good. Reviewed-by: Chaitanya Kulkarni -- dm-devel mailing list dm-devel@redhat.com

Re: [dm-devel] [PATCH 04/30] drbd: use bdev_nr_sectors instead of open coding it

2021-10-18 Thread Lee Duncan
On 10/15/21 6:26 AM, Christoph Hellwig wrote: > Use the proper helper to read the block device size. > > Signed-off-by: Christoph Hellwig > Reviewed-by: Kees Cook > Reviewed-by: Chaitanya Kulkarni > --- > drivers/block/drbd/drbd_int.h | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-)

[dm-devel] [PATCH 23/30] squashfs: use bdev_nr_bytes instead of open coding it

2021-10-18 Thread Christoph Hellwig
Use the proper helper to read the block device size. Signed-off-by: Christoph Hellwig Reviewed-by: Kees Cook Acked-by: Phillip Lougher --- fs/squashfs/super.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fs/squashfs/super.c b/fs/squashfs/super.c index

[dm-devel] [PATCH 30/30] udf: use sb_bdev_nr_blocks

2021-10-18 Thread Christoph Hellwig
Use the sb_bdev_nr_blocks helper instead of open coding it. Signed-off-by: Christoph Hellwig Reviewed-by: Kees Cook Reviewed-by: Jan Kara --- fs/udf/lowlevel.c | 5 ++--- fs/udf/super.c| 9 +++-- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/fs/udf/lowlevel.c

[dm-devel] [PATCH 28/30] ntfs: use sb_bdev_nr_blocks

2021-10-18 Thread Christoph Hellwig
Use the sb_bdev_nr_blocks helper instead of open coding it and clean up ntfs_fill_super a bit by moving an assignment a little earlier that has no negative side effects. Signed-off-by: Christoph Hellwig Reviewed-by: Kees Cook Acked-by: Anton Altaparmakov --- fs/ntfs/super.c | 8 +++- 1

[dm-devel] [PATCH 27/30] jfs: use sb_bdev_nr_blocks

2021-10-18 Thread Christoph Hellwig
Use the sb_bdev_nr_blocks helper instead of open coding it. Signed-off-by: Christoph Hellwig Reviewed-by: Kees Cook Acked-by: Dave Kleikamp --- fs/jfs/resize.c | 3 +-- fs/jfs/super.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/fs/jfs/resize.c b/fs/jfs/resize.c

[dm-devel] [PATCH 29/30] reiserfs: use sb_bdev_nr_blocks

2021-10-18 Thread Christoph Hellwig
Use the sb_bdev_nr_blocks helper instead of open coding it. Signed-off-by: Christoph Hellwig Reviewed-by: Kees Cook Reviewed-by: Jan Kara --- fs/reiserfs/super.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/fs/reiserfs/super.c b/fs/reiserfs/super.c index

[dm-devel] [PATCH 26/30] ext4: use sb_bdev_nr_blocks

2021-10-18 Thread Christoph Hellwig
Use the sb_bdev_nr_blocks helper instead of open coding it. Signed-off-by: Christoph Hellwig Reviewed-by: Kees Cook Reviewed-by: Jan Kara Reviewed-by: Chaitanya Kulkarni Acked-by: Theodore Ts'o --- fs/ext4/super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[dm-devel] [PATCH 24/30] block: use bdev_nr_bytes instead of open coding it in blkdev_fallocate

2021-10-18 Thread Christoph Hellwig
Use the proper helper to read the block device size. Signed-off-by: Christoph Hellwig Reviewed-by: Kees Cook Reviewed-by: Jan Kara Reviewed-by: Chaitanya Kulkarni --- block/fops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/fops.c b/block/fops.c index

[dm-devel] [PATCH 21/30] pstore/blk: use bdev_nr_bytes instead of open coding it

2021-10-18 Thread Christoph Hellwig
Use the proper helper to read the block device size. Signed-off-by: Christoph Hellwig Acked-by: Kees Cook --- fs/pstore/blk.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/fs/pstore/blk.c b/fs/pstore/blk.c index 04ce58c939a0b..5d1fbaffd66a1 100644 ---

[dm-devel] [PATCH 20/30] ntfs3: use bdev_nr_bytes instead of open coding it

2021-10-18 Thread Christoph Hellwig
Use the proper helper to read the block device size. Signed-off-by: Christoph Hellwig --- fs/ntfs3/super.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fs/ntfs3/super.c b/fs/ntfs3/super.c index 55bbc9200a10e..7ed2cb5e8b1d9 100644 --- a/fs/ntfs3/super.c +++

[dm-devel] [PATCH 25/30] block: add a sb_bdev_nr_blocks helper

2021-10-18 Thread Christoph Hellwig
Add a helper to return the size of sb->s_bdev in sb->s_blocksize_bits based unites. Signed-off-by: Christoph Hellwig Reviewed-by: Kees Cook Reviewed-by: Chaitanya Kulkarni --- include/linux/genhd.h | 6 ++ 1 file changed, 6 insertions(+) diff --git a/include/linux/genhd.h

[dm-devel] [PATCH 17/30] jfs: use bdev_nr_bytes instead of open coding it

2021-10-18 Thread Christoph Hellwig
Use the proper helper to read the block device size. Signed-off-by: Christoph Hellwig Reviewed-by: Kees Cook Acked-by: Dave Kleikamp --- fs/jfs/resize.c | 2 +- fs/jfs/super.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/jfs/resize.c b/fs/jfs/resize.c index

[dm-devel] [PATCH 19/30] nilfs2: use bdev_nr_bytes instead of open coding it

2021-10-18 Thread Christoph Hellwig
Use the proper helper to read the block device size. Signed-off-by: Christoph Hellwig Reviewed-by: Kees Cook Acked-by: Ryusuke Konishi --- fs/nilfs2/ioctl.c | 2 +- fs/nilfs2/super.c | 2 +- fs/nilfs2/the_nilfs.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git

[dm-devel] [PATCH 22/30] reiserfs: use bdev_nr_bytes instead of open coding it

2021-10-18 Thread Christoph Hellwig
Use the proper helper to read the block device size and remove two cargo culted checks that can't be false. Signed-off-by: Christoph Hellwig Reviewed-by: Kees Cook Reviewed-by: Jan Kara Reviewed-by: Chaitanya Kulkarni --- fs/reiserfs/super.c | 4 +--- 1 file changed, 1 insertion(+), 3

[dm-devel] [PATCH 18/30] nfs/blocklayout: use bdev_nr_bytes instead of open coding it

2021-10-18 Thread Christoph Hellwig
Use the proper helper to read the block device size. Signed-off-by: Christoph Hellwig Reviewed-by: Kees Cook --- fs/nfs/blocklayout/dev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/nfs/blocklayout/dev.c b/fs/nfs/blocklayout/dev.c index

[dm-devel] [PATCH 15/30] hfs: use bdev_nr_sectors instead of open coding it

2021-10-18 Thread Christoph Hellwig
Use the proper helper to read the block device size. Signed-off-by: Christoph Hellwig Reviewed-by: Kees Cook --- fs/hfs/mdb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/hfs/mdb.c b/fs/hfs/mdb.c index cdf0edeeb2781..5beb826524354 100644 --- a/fs/hfs/mdb.c +++

[dm-devel] [PATCH 13/30] cramfs: use bdev_nr_bytes instead of open coding it

2021-10-18 Thread Christoph Hellwig
Use the proper helper to read the block device size. Signed-off-by: Christoph Hellwig Reviewed-by: Kees Cook --- fs/cramfs/inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/cramfs/inode.c b/fs/cramfs/inode.c index 2be65269a987c..666aa380011e0 100644 ---

[dm-devel] [PATCH 12/30] btrfs: use bdev_nr_bytes instead of open coding it

2021-10-18 Thread Christoph Hellwig
Use the proper helper to read the block device size. Signed-off-by: Christoph Hellwig Reviewed-by: Kees Cook Reviewed-by: Anand Jain Reviewed-by: Chaitanya Kulkarni Acked-by: David Sterba --- fs/btrfs/dev-replace.c | 3 +-- fs/btrfs/disk-io.c | 2 +- fs/btrfs/ioctl.c | 4 ++--

[dm-devel] [PATCH 16/30] hfsplus: use bdev_nr_sectors instead of open coding it

2021-10-18 Thread Christoph Hellwig
Use the proper helper to read the block device size. Signed-off-by: Christoph Hellwig Reviewed-by: Kees Cook --- fs/hfsplus/wrapper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/hfsplus/wrapper.c b/fs/hfsplus/wrapper.c index 0350dc7821bf9..51ae6f1eb4a55 100644 ---

[dm-devel] [PATCH 07/30] nvmet: use bdev_nr_bytes instead of open coding it

2021-10-18 Thread Christoph Hellwig
Use the proper helper to read the block device size. Signed-off-by: Christoph Hellwig Reviewed-by: Kees Cook Reviewed-by: Chaitanya Kulkarni --- drivers/nvme/target/io-cmd-bdev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/nvme/target/io-cmd-bdev.c

[dm-devel] [PATCH 14/30] fat: use bdev_nr_sectors instead of open coding it

2021-10-18 Thread Christoph Hellwig
Use the proper helper to read the block device size. Signed-off-by: Christoph Hellwig Reviewed-by: Kees Cook --- fs/fat/inode.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/fs/fat/inode.c b/fs/fat/inode.c index de0c9b013a851..9f3cd03668adc 100644 --- a/fs/fat/inode.c

[dm-devel] [PATCH 11/30] affs: use bdev_nr_sectors instead of open coding it

2021-10-18 Thread Christoph Hellwig
Use the proper helper to read the block device size. Signed-off-by: Christoph Hellwig Reviewed-by: Kees Cook Reviewed-by: Chaitanya Kulkarni --- fs/affs/super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/affs/super.c b/fs/affs/super.c index

[dm-devel] [PATCH 10/30] fs: simplify init_page_buffers

2021-10-18 Thread Christoph Hellwig
No need to convert from bdev to inode and back. Signed-off-by: Christoph Hellwig Reviewed-by: Kees Cook Reviewed-by: Jan Kara --- fs/buffer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/buffer.c b/fs/buffer.c index 156358977249f..46bc589b7a03c 100644 ---

[dm-devel] [PATCH 08/30] target/iblock: use bdev_nr_bytes instead of open coding it

2021-10-18 Thread Christoph Hellwig
Use the proper helper to read the block device size. Signed-off-by: Christoph Hellwig Reviewed-by: Kees Cook Reviewed-by: Chaitanya Kulkarni --- drivers/target/target_core_iblock.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/target/target_core_iblock.c

[dm-devel] [PATCH 05/30] dm: use bdev_nr_sectors and bdev_nr_bytes instead of open coding them

2021-10-18 Thread Christoph Hellwig
Use the proper helpers to read the block device size. Signed-off-by: Christoph Hellwig Reviewed-by: Kees Cook Acked-by: Mike Snitzer --- drivers/md/dm-bufio.c | 2 +- drivers/md/dm-cache-metadata.c | 2 +- drivers/md/dm-cache-target.c| 2 +- drivers/md/dm-clone-target.c| 2

[dm-devel] [PATCH 09/30] fs: use bdev_nr_bytes instead of open coding it in blkdev_max_block

2021-10-18 Thread Christoph Hellwig
Use the proper helper to read the block device size. Signed-off-by: Christoph Hellwig Reviewed-by: Kees Cook Reviewed-by: Jan Kara Reviewed-by: Chaitanya Kulkarni --- fs/buffer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/buffer.c b/fs/buffer.c index

[dm-devel] [PATCH 03/30] bcache: remove bdev_sectors

2021-10-18 Thread Christoph Hellwig
Use the equivalent block layer helper instead. Signed-off-by: Christoph Hellwig Reviewed-by: Kees Cook Reviewed-by: Chaitanya Kulkarni Acked-by: Coly Li --- drivers/md/bcache/super.c | 2 +- drivers/md/bcache/util.h | 4 drivers/md/bcache/writeback.c | 2 +- 3 files changed, 2

[dm-devel] [PATCH 01/30] block: move the SECTOR_SIZE related definitions to blk_types.h

2021-10-18 Thread Christoph Hellwig
Ensure these are always available for inlines in the various block layer headers. Signed-off-by: Christoph Hellwig Reviewed-by: Kees Cook Reviewed-by: Jan Kara Reviewed-by: Chaitanya Kulkarni --- include/linux/blk_types.h | 17 + include/linux/blkdev.h| 17

[dm-devel] [PATCH 06/30] md: use bdev_nr_sectors instead of open coding it

2021-10-18 Thread Christoph Hellwig
Use the proper helper to read the block device size. Signed-off-by: Christoph Hellwig Reviewed-by: Kees Cook Acked-by: Song Liu --- drivers/md/md.c | 26 +++--- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/drivers/md/md.c b/drivers/md/md.c index

[dm-devel] [PATCH 02/30] block: add a bdev_nr_bytes helper

2021-10-18 Thread Christoph Hellwig
Add a helper to query the size of a block device in bytes. This will be used to remove open coded access to ->bd_inode. Signed-off-by: Christoph Hellwig Reviewed-by: Kees Cook --- include/linux/genhd.h | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git

[dm-devel] don't use ->bd_inode to access the block device size v3

2021-10-18 Thread Christoph Hellwig
Hi Jens, various drivers currently poke directy at the block device inode, which is a bit of a mess. This series cleans up the places that read the block device size to use the proper helpers. I have separate patches for many of the other bd_inode uses, but this series is already big enough

[dm-devel] [PATCH 04/30] drbd: use bdev_nr_sectors instead of open coding it

2021-10-18 Thread Christoph Hellwig
Use the proper helper to read the block device size. Signed-off-by: Christoph Hellwig Reviewed-by: Kees Cook Reviewed-by: Lee Duncan Reviewed-by: Chaitanya Kulkarni --- drivers/block/drbd/drbd_int.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git

Re: [dm-devel] [PATCH 20/30] ntfs3: use bdev_nr_bytes instead of open coding it

2021-10-18 Thread Kari Argillander
On Fri, Oct 15, 2021 at 03:26:33PM +0200, Christoph Hellwig wrote: > Use the proper helper to read the block device size. > > Signed-off-by: Christoph Hellwig > --- > fs/ntfs3/super.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/fs/ntfs3/super.c b/fs/ntfs3/super.c

Re: [dm-devel] [PATCH 27/30] jfs: use sb_bdev_nr_blocks

2021-10-18 Thread Dave Kleikamp
On 10/15/21 8:26AM, Christoph Hellwig wrote: Use the sb_bdev_nr_blocks helper instead of open coding it. Signed-off-by: Christoph Hellwig Reviewed-by: Kees Cook Acked-by: Dave Kleikamp --- fs/jfs/resize.c | 3 +-- fs/jfs/super.c | 3 +-- 2 files changed, 2 insertions(+), 4

Re: [dm-devel] [PATCH 02/30] block: add a bdev_nr_bytes helper

2021-10-18 Thread Anton Altaparmakov
Hi Christoph, > On 15 Oct 2021, at 14:26, Christoph Hellwig wrote: > > Add a helpe to query the size of a block device in bytes. This > will be used to remove open coded access to ->bd_inode. Matthew already pointed out the return type for bdev_nr_bytes() but also your commit message has a

Re: [dm-devel] [PATCH 12/30] btrfs: use bdev_nr_bytes instead of open coding it

2021-10-18 Thread David Sterba
On Fri, Oct 15, 2021 at 03:26:25PM +0200, Christoph Hellwig wrote: > Use the proper helper to read the block device size. > > Signed-off-by: Christoph Hellwig > Reviewed-by: Anand Jain > Reviewed-by: Chaitanya Kulkarni Acked-by: David Sterba -- dm-devel mailing list dm-devel@redhat.com

Re: [dm-devel] [PATCH 19/30] nilfs2: use bdev_nr_bytes instead of open coding it

2021-10-18 Thread Ryusuke Konishi
On Fri, Oct 15, 2021 at 10:27 PM Christoph Hellwig wrote: > > Use the proper helper to read the block device size. > > Signed-off-by: Christoph Hellwig Acked-by: Ryusuke Konishi Thanks, Ryusuke Konishi -- dm-devel mailing list dm-devel@redhat.com

Re: [dm-devel] [PATCH 28/30] ntfs: use sb_bdev_nr_blocks

2021-10-18 Thread Anton Altaparmakov
Hi Christoph, Looks good, thank you. Best regards, Anton > On 15 Oct 2021, at 14:26, Christoph Hellwig wrote: > > Use the sb_bdev_nr_blocks helper instead of open coding it and clean up > ntfs_fill_super a bit by moving an assignment a little earlier that has > no negative side