Re: [RFC][PATCH v3 01/10] fs: common implementation of file type

2018-10-25 Thread Jan Kara
On Tue 23-10-18 21:19:53, Phillip Potter wrote: > Many file systems use a copy&paste implementation > of dirent to on-disk file type conversions. > > Create a common implementation to be used by file systems > with some useful conversion helpers to reduce open coded > file type conversions in file

Re: [RFC][PATCH v3 01/10] fs: common implementation of file type

2018-10-24 Thread Amir Goldstein
On Wed, Oct 24, 2018 at 4:02 PM Theodore Y. Ts'o wrote: > > On Tue, Oct 23, 2018 at 09:19:53PM +0100, Phillip Potter wrote: > > diff --git a/include/linux/file_type.h b/include/linux/file_type.h > > Shouldn't this be in include/uapi/linux/fs_types.h? > IDGI. Why do we want this file in uapi? The

Re: [RFC][PATCH v3 01/10] fs: common implementation of file type

2018-10-24 Thread Theodore Y. Ts'o
On Tue, Oct 23, 2018 at 09:19:53PM +0100, Phillip Potter wrote: > diff --git a/include/linux/file_type.h b/include/linux/file_type.h Shouldn't this be in include/uapi/linux/fs_types.h? One of things which must be made crystal clear is these definitions MUST NOT ever change. It would break the Us

Re: [RFC][PATCH v3 01/10] fs: common implementation of file type

2018-10-24 Thread Al Viro
On Tue, Oct 23, 2018 at 09:19:53PM +0100, Phillip Potter wrote: > +static inline unsigned char fs_dtype(int filetype) That "int" is asking for trouble, especially since negative argument will blow up. And it comes from untrusted source... > +{ > + if (filetype >= FT_MAX) > + ret

Re: [RFC][PATCH v3 01/10] fs: common implementation of file type

2018-10-24 Thread Amir Goldstein
On Wed, Oct 24, 2018 at 12:56 PM Phillip Potter wrote: > > On Wed, Oct 24, 2018 at 12:44:50PM +0300, Amir Goldstein wrote: ... > > Well, I did request to change some content (the location and the comment > > above BUILD_BUG_ON section) which is relevant for several patches. > > However, so far aff

Re: [RFC][PATCH v3 01/10] fs: common implementation of file type

2018-10-24 Thread Phillip Potter
On Wed, Oct 24, 2018 at 12:44:50PM +0300, Amir Goldstein wrote: > On Wed, Oct 24, 2018 at 12:31 PM Phillip Potter wrote: > > > > On Wed, Oct 24, 2018 at 12:20:14PM +0300, Amir Goldstein wrote: > > > On Wed, Oct 24, 2018 at 11:21 AM Phillip Potter > > > wrote: > > > > Dear Amir, > > > > > > > > Y

Re: [RFC][PATCH v3 01/10] fs: common implementation of file type

2018-10-24 Thread Amir Goldstein
On Wed, Oct 24, 2018 at 12:31 PM Phillip Potter wrote: > > On Wed, Oct 24, 2018 at 12:20:14PM +0300, Amir Goldstein wrote: > > On Wed, Oct 24, 2018 at 11:21 AM Phillip Potter > > wrote: > > > Dear Amir, > > > > > > Yes, I applied each patch manually to my tree, fixed it up where needed, > > > th

Re: [RFC][PATCH v3 01/10] fs: common implementation of file type

2018-10-24 Thread Phillip Potter
On Wed, Oct 24, 2018 at 12:20:14PM +0300, Amir Goldstein wrote: > On Wed, Oct 24, 2018 at 11:21 AM Phillip Potter wrote: > > Dear Amir, > > > > Yes, I applied each patch manually to my tree, fixed it up where needed, > > then after rebuilding and testing each one I committed it and regenerated > >

Re: [RFC][PATCH v3 01/10] fs: common implementation of file type

2018-10-24 Thread Amir Goldstein
On Wed, Oct 24, 2018 at 11:21 AM Phillip Potter wrote: > > On Wed, Oct 24, 2018 at 09:16:20AM +0300, Amir Goldstein wrote: > > On Tue, Oct 23, 2018 at 11:19 PM Phillip Potter > > wrote: > > > > > > Many file systems use a copy&paste implementation > > > of dirent to on-disk file type conversions

Re: [RFC][PATCH v3 01/10] fs: common implementation of file type

2018-10-24 Thread Phillip Potter
On Wed, Oct 24, 2018 at 09:16:20AM +0300, Amir Goldstein wrote: > On Tue, Oct 23, 2018 at 11:19 PM Phillip Potter wrote: > > > > Many file systems use a copy&paste implementation > > of dirent to on-disk file type conversions. > > > > Create a common implementation to be used by file systems > > w

Re: [RFC][PATCH v3 01/10] fs: common implementation of file type

2018-10-23 Thread Amir Goldstein
On Tue, Oct 23, 2018 at 11:19 PM Phillip Potter wrote: > > Many file systems use a copy&paste implementation > of dirent to on-disk file type conversions. > > Create a common implementation to be used by file systems > with some useful conversion helpers to reduce open coded > file type conversion