Re: [RFC v2 09/11] block/bdev: lift block size restrictions and use common definition

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 16/12/2024 08:55, John Garry wrote:
On 14/12/2024 03:10, Luis Chamberlain wrote:
index 167d82b46781..b57dc4bff81b 100644
--- a/block/bdev.c
+++ b/block/bdev.c
@@ -157,8 +157,7 @@ int set_blocksize(struct file *file, int size)
      struct inode *inode = file->f_mapping->host;
      struct block_device *bdev = I_BDEV(inode);
-    /* Size must be a power of two, and between 512 and PAGE_SIZE */
-    if (size > PAGE_SIZE || size < 512 || !is_power_of_2(size))
+    if (blk_validate_block_size(size))
          return -EINVAL;

I suppose that this can be sent as a separate patch to be merged now.

And if you want to send this as a separate prep change, feel free to add:

Reviewed-by: John Garry <john.g.garry@xxxxxxxxxx>




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux