We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent be26ba9 commit 26fff8aCopy full SHA for 26fff8a
block/bdev.c
@@ -155,8 +155,7 @@ int set_blocksize(struct file *file, int size)
155
struct inode *inode = file->f_mapping->host;
156
struct block_device *bdev = I_BDEV(inode);
157
158
- /* Size must be a power of two, and between 512 and PAGE_SIZE */
159
- if (size > PAGE_SIZE || size < 512 || !is_power_of_2(size))
+ if (blk_validate_block_size(size))
160
return -EINVAL;
161
162
/* Size cannot be smaller than the size supported by the device */
0 commit comments