Re: [RFC 8/8] bdev: use bdev_io_min() for statx block size

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

 



On Mon, Nov 18, 2024 at 01:16:37PM -0800, Luis Chamberlain wrote:
> On Mon, Nov 18, 2024 at 08:08:05AM +0100, Christoph Hellwig wrote:
> > On Wed, Nov 13, 2024 at 01:47:27AM -0800, Luis Chamberlain wrote:
> > >  	if (S_ISBLK(stat->mode))
> > > -		bdev_statx(path, stat, request_mask);
> > > +		bdev_statx(path, stat, request_mask | STATX_DIOALIGN);
> > 
> > And this is both unrelated and wrong.
> 
> I knew this was an eyesore, but was not sure if we really wanted to
> go through the trouble of adding a new field for blksize alone, but come
> to think of it, with it at least userspace knows for sure its
> getting where as befault it was not.

Huh?  The only think this does is forcing to fill out the dio align
fields when not requested.  It has nothing to do with block sizes.

> So how about:
> 
> diff --git a/block/bdev.c b/block/bdev.c
> index 3a5fd65f6c8e..f5d7cda97616 100644
> --- a/block/bdev.c
> +++ b/block/bdev.c
> @@ -1277,7 +1277,8 @@ void bdev_statx(struct path *path, struct kstat *stat,
>  	struct inode *backing_inode;
>  	struct block_device *bdev;
>  
> -	if (!(request_mask & (STATX_DIOALIGN | STATX_WRITE_ATOMIC)))
> +	if (!(request_mask & (STATX_DIOALIGN | STATX_WRITE_ATOMIC |
> +			      STATX_BLKSIZE)))

Just drop this conditional entirely and you're fine.





[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux