[dm-devel] [PATCH 6/9] m68k/emu/nfblock: add error handling support for add_disk()

2021-10-15 Thread Luis Chamberlain
We never checked for errors on add_disk() as this function returned void. Now that this is fixed, use the shiny new error handling. Reviewed-by: Geert Uytterhoeven Acked-by: Geert Uytterhoeven Signed-off-by: Luis Chamberlain --- arch/m68k/emu/nfblock.c | 9 +++-- 1 file changed, 7

[dm-devel] [PATCH 7/9] um/drivers/ubd_kern: add error handling support for add_disk()

2021-10-15 Thread Luis Chamberlain
We never checked for errors on add_disk() as this function returned void. Now that this is fixed, use the shiny new error handling. ubd_disk_register() never returned an error, so just fix that now and let the caller handle the error condition. Reviewed-by: Gabriel Krisman Bertazi

[dm-devel] [PATCH 3/9] dm: add add_disk() error handling

2021-10-15 Thread Luis Chamberlain
We never checked for errors on add_disk() as this function returned void. Now that this is fixed, use the shiny new error handling. There are two calls to dm_setup_md_queue() which can fail then, one on dm_early_create() and we can easily see that the error path there calls dm_destroy in the

[dm-devel] [PATCH 2/9] scsi/sr: add error handling support for add_disk()

2021-10-15 Thread Luis Chamberlain
We never checked for errors on add_disk() as this function returned void. Now that this is fixed, use the shiny new error handling. Just put the cdrom kref and have the unwinding be done by sr_kref_release(). Reviewed-by: Christoph Hellwig Signed-off-by: Luis Chamberlain --- drivers/scsi/sr.c

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

2021-10-15 Thread Luis Chamberlain
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 and just put the device so that cleanup is done via the scsi_disk_release(). Reviewed-by:

[dm-devel] [PATCH 4/9] bcache: add error handling support for add_disk()

2021-10-15 Thread Luis Chamberlain
We never checked for errors on add_disk() as this function returned void. Now that this is fixed, use the shiny new error handling. This driver doesn't do any unwinding with blk_cleanup_disk() even on errors after add_disk() and so we follow that tradition. Acked-by: Coly Li Signed-off-by: Luis

[dm-devel] [PATCH 8/9] rnbd: add error handling support for add_disk()

2021-10-15 Thread Luis Chamberlain
We never checked for errors on add_disk() as this function returned void. Now that this is fixed, use the shiny new error handling. Acked-by: Jack Wang Signed-off-by: Luis Chamberlain --- drivers/block/rnbd/rnbd-clt.c | 13 + 1 file changed, 9 insertions(+), 4 deletions(-) diff

[dm-devel] [PATCH 0/9] block: reviewed add_disk() error handling set

2021-10-15 Thread Luis Chamberlain
Jens, I had last split up patches into 7 groups, but at this point now most changes are merged except a few more drivers. Instead of creating a new patch set for each of the 7 groups I'm creating 3 new groups of patches now: * This set, for which we already have an Acked-by or Reviewed-by tag,

[dm-devel] [PATCH 5/9] xen-blkfront: add error handling support for add_disk()

2021-10-15 Thread Luis Chamberlain
We never checked for errors on device_add_disk() as this function returned void. Now that this is fixed, use the shiny new error handling. The function xlvbd_alloc_gendisk() typically does the unwinding on error on allocating the disk and creating the tag, but since all that error handling was

[dm-devel] [git pull] device mapper fixes for 5.15-rc6

2021-10-15 Thread Mike Snitzer
Hi Linus, The following changes since commit 64570fbc14f8d7cb3fe3995f20e26bc25ce4b2cc: Linux 5.15-rc5 (2021-10-10 17:01:59 -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.15/dm-fixes for you to fetch

Re: [dm-devel] [RFC PATCH v7 12/16] fsverity|security: add security hooks to fsverity digest and signature

2021-10-15 Thread Eric Biggers
On Fri, Oct 15, 2021 at 12:25:53PM -0700, Deven Bowers wrote: > > On 10/13/2021 12:24 PM, Eric Biggers wrote: > > On Wed, Oct 13, 2021 at 12:06:31PM -0700, deven.de...@linux.microsoft.com > > wrote: > > > From: Fan Wu > > > > > > Add security_inode_setsecurity to fsverity signature

Re: [dm-devel] [RFC PATCH v7 07/16] ipe: add auditing support

2021-10-15 Thread Randy Dunlap
On 10/15/21 12:25 PM, Deven Bowers wrote: On 10/13/2021 3:54 PM, Randy Dunlap wrote: Hi, On 10/13/21 12:06 PM, deven.de...@linux.microsoft.com wrote: diff --git a/security/ipe/Kconfig b/security/ipe/Kconfig index c4503083e92d..ef556b66e674 100644 --- a/security/ipe/Kconfig +++

Re: [dm-devel] [RFC PATCH v7 12/16] fsverity|security: add security hooks to fsverity digest and signature

2021-10-15 Thread Deven Bowers
On 10/13/2021 12:24 PM, Eric Biggers wrote: On Wed, Oct 13, 2021 at 12:06:31PM -0700, deven.de...@linux.microsoft.com wrote: From: Fan Wu Add security_inode_setsecurity to fsverity signature verification. This can let LSMs save the signature data and digest hashes provided by fsverity. Can

Re: [dm-devel] [RFC PATCH v7 05/16] ipe: add LSM hooks on execution and kernel read

2021-10-15 Thread Deven Bowers
On 10/13/2021 1:04 PM, Casey Schaufler wrote: On 10/13/2021 12:06 PM, deven.de...@linux.microsoft.com wrote: From: Deven Bowers IPE's initial goal is to control both execution and the loading of kernel modules based on the system's definition of trust. It accomplishes this by plugging into

Re: [dm-devel] [RFC PATCH v7 07/16] ipe: add auditing support

2021-10-15 Thread Deven Bowers
On 10/13/2021 3:54 PM, Randy Dunlap wrote: Hi, On 10/13/21 12:06 PM, deven.de...@linux.microsoft.com wrote: diff --git a/security/ipe/Kconfig b/security/ipe/Kconfig index c4503083e92d..ef556b66e674 100644 --- a/security/ipe/Kconfig +++ b/security/ipe/Kconfig @@ -17,3 +17,55 @@ menuconfig

Re: [dm-devel] [RFC PATCH v7 07/16] ipe: add auditing support

2021-10-15 Thread Deven Bowers
On 10/13/2021 1:02 PM, Steve Grubb wrote: Hello, On Wednesday, October 13, 2021 3:06:26 PM EDT deven.de...@linux.microsoft.com wrote: Users of IPE require a way to identify when and why an operation fails, allowing them to both respond to violations of policy and be notified of potentially

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

2021-10-15 Thread Kees Cook
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: Kees Cook -- Kees Cook -- dm-devel mailing list dm-devel@redhat.com

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

2021-10-15 Thread Kees Cook
On Fri, Oct 15, 2021 at 03:26:38PM +0200, 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. > >

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

2021-10-15 Thread Kees Cook
On Fri, Oct 15, 2021 at 03:26:37PM +0200, Christoph Hellwig wrote: > Use the proper helper to read the block device size. > > Signed-off-by: Christoph Hellwig Reviewed-by: Kees Cook -- Kees Cook -- dm-devel mailing list dm-devel@redhat.com

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

2021-10-15 Thread Kees Cook
On Fri, Oct 15, 2021 at 03:26:36PM +0200, Christoph Hellwig wrote: > Use the proper helper to read the block device size. > > Signed-off-by: Christoph Hellwig Reviewed-by: Kees Cook -- Kees Cook -- dm-devel mailing list dm-devel@redhat.com

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

2021-10-15 Thread Kees Cook
On Fri, Oct 15, 2021 at 03:26:35PM +0200, 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: Kees Cook -- Kees Cook -- dm-devel mailing list

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

2021-10-15 Thread Kees Cook
On Fri, Oct 15, 2021 at 03:26:34PM +0200, Christoph Hellwig wrote: > Use the proper helper to read the block device size. > > Signed-off-by: Christoph Hellwig Thanks for the bdev_by_bytes() helper; this is more readable now. :) Acked-by: Kees Cook -- Kees Cook -- dm-devel mailing list

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

2021-10-15 Thread Kees Cook
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 Reviewed-by: Kees Cook -- Kees Cook -- 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-15 Thread Kees Cook
On Fri, Oct 15, 2021 at 03:26:32PM +0200, Christoph Hellwig wrote: > Use the proper helper to read the block device size. > > Signed-off-by: Christoph Hellwig Reviewed-by: Kees Cook -- Kees Cook -- dm-devel mailing list dm-devel@redhat.com

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

2021-10-15 Thread Kees Cook
On Fri, Oct 15, 2021 at 03:26:31PM +0200, Christoph Hellwig wrote: > Use the proper helper to read the block device size. > > Signed-off-by: Christoph Hellwig Reviewed-by: Kees Cook -- Kees Cook -- dm-devel mailing list dm-devel@redhat.com

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

2021-10-15 Thread Kees Cook
On Fri, Oct 15, 2021 at 03:26:30PM +0200, Christoph Hellwig wrote: > Use the proper helper to read the block device size. > > Signed-off-by: Christoph Hellwig Reviewed-by: Kees Cook -- Kees Cook -- dm-devel mailing list dm-devel@redhat.com

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

2021-10-15 Thread Kees Cook
On Fri, Oct 15, 2021 at 03:26:26PM +0200, Christoph Hellwig wrote: > Use the proper helper to read the block device size. > > Signed-off-by: Christoph Hellwig Reviewed-by: Kees Cook -- Kees Cook -- dm-devel mailing list dm-devel@redhat.com

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

2021-10-15 Thread Kees Cook
On Fri, Oct 15, 2021 at 03:26:22PM +0200, Christoph Hellwig wrote: > Use the proper helper to read the block device size. > > Signed-off-by: Christoph Hellwig Reviewed-by: Kees Cook -- Kees Cook -- dm-devel mailing list dm-devel@redhat.com

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

2021-10-15 Thread Kees Cook
On Fri, Oct 15, 2021 at 03:26:21PM +0200, Christoph Hellwig wrote: > Use the proper helper to read the block device size. > > Signed-off-by: Christoph Hellwig > Reviewed-by: Chaitanya Kulkarni Is this basically an open-coded non-sb version of sb_bdev_nr_blocks()? Reviewed-by: Kees Cook >

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

2021-10-15 Thread Kees Cook
On Fri, Oct 15, 2021 at 02:37:41PM +, Anton Altaparmakov wrote: > 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

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

2021-10-15 Thread Kees Cook
On Fri, Oct 15, 2021 at 03:26:20PM +0200, Christoph Hellwig wrote: > Use the proper helper to read the block device size. > > Signed-off-by: Christoph Hellwig Reviewed-by: Kees Cook -- Kees Cook -- dm-devel mailing list dm-devel@redhat.com

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

2021-10-15 Thread Kees Cook
On Fri, Oct 15, 2021 at 03:26:14PM +0200, Christoph Hellwig wrote: > Ensure these are always available for inlines in the various block layer > headers. > > Signed-off-by: Christoph Hellwig Awesome, yes. Thanks! Reviewed-by: Kees Cook -- Kees Cook -- dm-devel mailing list

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

2021-10-15 Thread Christoph Hellwig
Use the proper helper to read the block device size. Signed-off-by: Christoph Hellwig Reviewed-by: Kees Cook --- 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 c6c2a513ec92d..c609005a9eaaa 100644 --- a/fs/affs/super.c

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

2021-10-15 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] don't use ->bd_inode to access the block device size v2

2021-10-15 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-15 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/block/drbd/drbd_int.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/block/drbd/drbd_int.h

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

2021-10-15 Thread Christoph Hellwig
Use the proper helper to read the block device size. Signed-off-by: Christoph Hellwig 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 c615387aedcae..156358977249f 100644

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

2021-10-15 Thread Christoph Hellwig
Use the equivalent block layer helper instead. Signed-off-by: Christoph Hellwig Reviewed-by: Kees Cook 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 insertions(+), 6 deletions(-)

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

2021-10-15 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-15 Thread Christoph Hellwig
Use the proper helper to read the block device size. Signed-off-by: Christoph Hellwig 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 19/30] nilfs2: use bdev_nr_bytes instead of open coding it

2021-10-15 Thread Christoph Hellwig
Use the proper helper to read the block device size. Signed-off-by: Christoph Hellwig --- 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 a/fs/nilfs2/ioctl.c b/fs/nilfs2/ioctl.c index

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

2021-10-15 Thread Christoph Hellwig
Use the proper helper to read the block device size. Signed-off-by: Christoph Hellwig --- 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 --- a/fs/cramfs/inode.c +++

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

2021-10-15 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 01/30] block: move the SECTOR_SIZE related definitions to blk_types.h

2021-10-15 Thread Christoph Hellwig
Ensure these are always available for inlines in the various block layer headers. Signed-off-by: Christoph Hellwig --- include/linux/blk_types.h | 17 + include/linux/blkdev.h| 17 - 2 files changed, 17 insertions(+), 17 deletions(-) diff --git

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

2021-10-15 Thread Christoph Hellwig
Use the proper helper to read the block device size. Signed-off-by: Christoph Hellwig Reviewed-by: Anand Jain Reviewed-by: Chaitanya Kulkarni --- fs/btrfs/dev-replace.c | 3 +-- fs/btrfs/disk-io.c | 2 +- fs/btrfs/ioctl.c | 4 ++-- fs/btrfs/volumes.c | 8 4 files

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

2021-10-15 Thread Matthew Wilcox
On Fri, Oct 15, 2021 at 03:26:15PM +0200, Christoph Hellwig wrote: > +static inline sector_t bdev_nr_bytes(struct block_device *bdev) > +{ > + return i_size_read(bdev->bd_inode); Uh. loff_t, surely? -- dm-devel mailing list dm-devel@redhat.com

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

2021-10-15 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: Jan Kara --- fs/reiserfs/super.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/fs/reiserfs/super.c

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

2021-10-15 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 02/30] block: add a bdev_nr_bytes helper

2021-10-15 Thread Christoph Hellwig
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. Signed-off-by: Christoph Hellwig --- include/linux/genhd.h | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/include/linux/genhd.h

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

2021-10-15 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 20/30] ntfs3: use bdev_nr_bytes instead of open coding it

2021-10-15 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 10/30] fs: simplify init_page_buffers

2021-10-15 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-15 Thread Christoph Hellwig
Use the proper helper to read the block device size. Signed-off-by: Christoph Hellwig 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 17/30] jfs: use bdev_nr_bytes instead of open coding it

2021-10-15 Thread Christoph Hellwig
Use the proper helper to read the block device size. Signed-off-by: Christoph Hellwig 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 bde787c354fcc..a42dbb0d3d28a

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

2021-10-15 Thread Jan Kara
On Fri 15-10-21 15:26:14, Christoph Hellwig wrote: > Ensure these are always available for inlines in the various block layer > headers. > > Signed-off-by: Christoph Hellwig Looks good. Feel free to add: Reviewed-by: Jan Kara

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

2021-10-15 Thread Christoph Hellwig
On Fri, Oct 15, 2021 at 02:35:15PM +0100, Matthew Wilcox wrote: > On Fri, Oct 15, 2021 at 03:26:15PM +0200, Christoph Hellwig wrote: > > +static inline sector_t bdev_nr_bytes(struct block_device *bdev) > > +{ > > + return i_size_read(bdev->bd_inode); > > Uh. loff_t, surely? Yes, that wuld be

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

2021-10-15 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 --- fs/ntfs/super.c | 8 +++- 1 file changed, 3 insertions(+), 5

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

2021-10-15 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 25/30] block: add a sb_bdev_nr_blocks helper

2021-10-15 Thread Christoph Hellwig
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: Christoph Hellwig --- include/linux/genhd.h | 6 ++ 1 file

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

2021-10-15 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 23/30] squashfs: use bdev_nr_bytes instead of open coding it

2021-10-15 Thread Christoph Hellwig
Use the proper helper to read the block device size. Signed-off-by: Christoph Hellwig 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 60d6951915f44..bb44ff4c5cc67 100644

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

2021-10-15 Thread Christoph Hellwig
Use the sb_bdev_nr_blocks helper instead of open coding it. Signed-off-by: Christoph Hellwig Reviewed-by: Kees Cook --- 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 index

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

2021-10-15 Thread Christoph Hellwig
Use the proper helper to read the block device size. Signed-off-by: Christoph Hellwig --- 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 --- a/fs/pstore/blk.c +++

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

2021-10-15 Thread Christoph Hellwig
Use the proper helper to read the block device size. Signed-off-by: Christoph Hellwig --- 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 acb1d22907daf..5e56da748b2ab 100644 ---

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

2021-10-15 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 Acked-by: Theodore Ts'o --- fs/ext4/super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/ext4/super.c b/fs/ext4/super.c index

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

2021-10-15 Thread Christoph Hellwig
Use the proper helper to read the block device size. Signed-off-by: Christoph Hellwig 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 7bb9581a146cf..a6a4d412720cd

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

2021-10-15 Thread Dave Kleikamp
On 10/14/21 4:32AM, Anton Altaparmakov wrote: Hi Christoph, On 14 Oct 2021, at 07:28, Christoph Hellwig wrote: On Wed, Oct 13, 2021 at 07:10:13AM +0200, Christoph Hellwig wrote: I wondered about adding a helper for looking at the size in byte units to avoid the SECTOR_SHIFT shifts in

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

2021-10-15 Thread Anton Altaparmakov
Hi Christoph, > On 14 Oct 2021, at 07:28, Christoph Hellwig wrote: > > On Wed, Oct 13, 2021 at 07:10:13AM +0200, Christoph Hellwig wrote: >> I wondered about adding a helper for looking at the size in byte units >> to avoid the SECTOR_SHIFT shifts in various places. But given that >> I could