Re: [PATCH v2 01/18] vfs: add miscattr ops

2021-03-24 Thread Miklos Szeredi
On Wed, Mar 24, 2021 at 1:28 PM Al Viro wrote: > > On Wed, Mar 24, 2021 at 09:45:02AM +0100, Miklos Szeredi wrote: > > Isn't structure initialization supposed to zero everything not > > explicitly initialized? > > All fields, but not the padding... Ah... while the structure is unlikely to

Re: [PATCH v2 01/18] vfs: add miscattr ops

2021-03-24 Thread Al Viro
On Wed, Mar 24, 2021 at 09:45:02AM +0100, Miklos Szeredi wrote: > On Wed, Mar 24, 2021 at 6:03 AM Al Viro wrote: > > > > On Mon, Mar 22, 2021 at 03:48:59PM +0100, Miklos Szeredi wrote: > > > > minor nit: copy_fsxattr_{to,from}_user() might be better. > > > > > +int fsxattr_copy_to_user(const

Re: [PATCH v2 01/18] vfs: add miscattr ops

2021-03-24 Thread Miklos Szeredi
On Wed, Mar 24, 2021 at 6:03 AM Al Viro wrote: > > On Mon, Mar 22, 2021 at 03:48:59PM +0100, Miklos Szeredi wrote: > > minor nit: copy_fsxattr_{to,from}_user() might be better. > > > +int fsxattr_copy_to_user(const struct miscattr *ma, struct fsxattr __user > > *ufa) > > +{ > > + struct

Re: [PATCH v2 01/18] vfs: add miscattr ops

2021-03-24 Thread Christian Brauner
On Mon, Mar 22, 2021 at 03:48:59PM +0100, Miklos Szeredi wrote: > There's a substantial amount of boilerplate in filesystems handling > FS_IOC_[GS]ETFLAGS/ FS_IOC_FS[GS]ETXATTR ioctls. > > Also due to userspace buffers being involved in the ioctl API this is > difficult to stack, as shown by

Re: [PATCH v2 01/18] vfs: add miscattr ops

2021-03-24 Thread Christian Brauner
On Mon, Mar 22, 2021 at 03:33:38PM -0700, Darrick J. Wong wrote: > On Mon, Mar 22, 2021 at 03:48:59PM +0100, Miklos Szeredi wrote: > > There's a substantial amount of boilerplate in filesystems handling > > FS_IOC_[GS]ETFLAGS/ FS_IOC_FS[GS]ETXATTR ioctls. > > > > Also due to userspace buffers

Re: [PATCH v2 01/18] vfs: add miscattr ops

2021-03-23 Thread Al Viro
On Mon, Mar 22, 2021 at 03:48:59PM +0100, Miklos Szeredi wrote: minor nit: copy_fsxattr_{to,from}_user() might be better. > +int fsxattr_copy_to_user(const struct miscattr *ma, struct fsxattr __user > *ufa) > +{ > + struct fsxattr fa = { > + .fsx_xflags = ma->fsx_xflags, > +

Re: [PATCH v2 01/18] vfs: add miscattr ops

2021-03-23 Thread David Sterba
On Mon, Mar 22, 2021 at 03:33:38PM -0700, Darrick J. Wong wrote: > On Mon, Mar 22, 2021 at 03:48:59PM +0100, Miklos Szeredi wrote: > > --- a/Documentation/filesystems/vfs.rst > > +++ b/Documentation/filesystems/vfs.rst > > @@ -441,6 +441,9 @@ As of kernel 2.6.22, the following members are defined:

Re: [PATCH v2 01/18] vfs: add miscattr ops

2021-03-22 Thread Amir Goldstein
> > +``miscattr_get`` > > I wish this wasn't named "misc" because miscellaneous is vague. > > fileattr_get, perhaps? > > (FWIW I'm not /that/ passionate about starting a naming bikeshed, feel > free to ignore.) > Eventual bikeshedding is hard to avoid in this case... I don't feel strongly

Re: [PATCH v2 01/18] vfs: add miscattr ops

2021-03-22 Thread Darrick J. Wong
On Mon, Mar 22, 2021 at 03:48:59PM +0100, Miklos Szeredi wrote: > There's a substantial amount of boilerplate in filesystems handling > FS_IOC_[GS]ETFLAGS/ FS_IOC_FS[GS]ETXATTR ioctls. > > Also due to userspace buffers being involved in the ioctl API this is > difficult to stack, as shown by

[PATCH v2 01/18] vfs: add miscattr ops

2021-03-22 Thread Miklos Szeredi
There's a substantial amount of boilerplate in filesystems handling FS_IOC_[GS]ETFLAGS/ FS_IOC_FS[GS]ETXATTR ioctls. Also due to userspace buffers being involved in the ioctl API this is difficult to stack, as shown by overlayfs issues related to these ioctls. Introduce a new internal API named