Re: [PATCH] fs: don't randomized kiocb fields

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

 



On Sun, Aug 14, 2022 at 11:35:35AM +0100, Matthew Wilcox wrote:
> On Fri, Aug 12, 2022 at 03:56:33PM -0700, Keith Busch wrote:
> >  struct kiocb {
> >  	struct file		*ki_filp;
> > -
> > -	/* The 'ki_filp' pointer is shared in a union for aio */
> > -	randomized_struct_fields_start
> > -
> >  	loff_t			ki_pos;
> >  	void (*ki_complete)(struct kiocb *iocb, long ret);
> >  	void			*private;
> >  	int			ki_flags;
> >  	u16			ki_ioprio; /* See linux/ioprio.h */
> >  	struct wait_page_queue	*ki_waitq; /* for async buffered IO */
> > -	randomized_struct_fields_end
> >  };
> 
> Now that I've read the thread ...
> 
> If we care about struct size on 32-bit, we should fit something into
> the 32-bit hole before the 64-bit loff_t (assuming at least some 32-bit
> arches want loff_t to be 64-bit aligned; I thik x86 doesn't?)
> Easiest seems to be to put ki_complete before ki_pos?

Yes, that would be a better compact arrangment. The immediate need was just to
correct io_uring's max command struct size. The 32-bit verison isn't near the
limit, so no additional optimizations were done in this patch. 



[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