Re: [PATCH v4 1/2] hugetlb: use f_mode & FMODE_HUGETLBFS to identify hugetlbfs files

2020-06-16 Thread Miklos Szeredi
On Tue, Jun 16, 2020 at 1:45 AM Mike Kravetz wrote: > > On 6/15/20 12:53 AM, Miklos Szeredi wrote: > > On Sat, Jun 13, 2020 at 9:12 PM Mike Kravetz > > wrote: > >> On 6/12/20 11:53 PM, Amir Goldstein wrote: > >>> > >>> The simplest thing for you to do in order to shush syzbot is what procfs >

Re: [PATCH v4 1/2] hugetlb: use f_mode & FMODE_HUGETLBFS to identify hugetlbfs files

2020-06-15 Thread Mike Kravetz
On 6/15/20 12:53 AM, Miklos Szeredi wrote: > On Sat, Jun 13, 2020 at 9:12 PM Mike Kravetz wrote: >> On 6/12/20 11:53 PM, Amir Goldstein wrote: >>> >>> The simplest thing for you to do in order to shush syzbot is what procfs >>> does: >>> /* >>> * procfs isn't actually a stacking

Re: [PATCH v4 1/2] hugetlb: use f_mode & FMODE_HUGETLBFS to identify hugetlbfs files

2020-06-15 Thread Mike Kravetz
On 6/15/20 1:24 AM, Miklos Szeredi wrote: > On Sat, Jun 13, 2020 at 8:53 AM Amir Goldstein wrote: > >>> I also looked at normal filesystem lower and hugetlbfs upper. Yes, >>> overlayfs >>> allows this. This is somewhat 'interesting' as write() is not supported in >>> hugetlbfs. Writing to

Re: [PATCH v4 1/2] hugetlb: use f_mode & FMODE_HUGETLBFS to identify hugetlbfs files

2020-06-15 Thread Miklos Szeredi
On Mon, Jun 15, 2020 at 12:05 PM Amir Goldstein wrote: > > On Mon, Jun 15, 2020 at 10:53 AM Miklos Szeredi wrote: > > > > On Sat, Jun 13, 2020 at 9:12 PM Mike Kravetz > > wrote: > > > > > > On 6/12/20 11:53 PM, Amir Goldstein wrote: > > > > > As a hugetlbfs developer, I do not know of a use

Re: [PATCH v4 1/2] hugetlb: use f_mode & FMODE_HUGETLBFS to identify hugetlbfs files

2020-06-15 Thread Amir Goldstein
On Mon, Jun 15, 2020 at 10:53 AM Miklos Szeredi wrote: > > On Sat, Jun 13, 2020 at 9:12 PM Mike Kravetz wrote: > > > > On 6/12/20 11:53 PM, Amir Goldstein wrote: > > > As a hugetlbfs developer, I do not know of a use case for interoperability > > with overlayfs. So yes, I am not too interested

Re: [PATCH v4 1/2] hugetlb: use f_mode & FMODE_HUGETLBFS to identify hugetlbfs files

2020-06-15 Thread Miklos Szeredi
On Sat, Jun 13, 2020 at 8:53 AM Amir Goldstein wrote: > > I also looked at normal filesystem lower and hugetlbfs upper. Yes, > > overlayfs > > allows this. This is somewhat 'interesting' as write() is not supported in > > hugetlbfs. Writing to files in the overlay actually ended up writing

Re: [PATCH v4 1/2] hugetlb: use f_mode & FMODE_HUGETLBFS to identify hugetlbfs files

2020-06-15 Thread Miklos Szeredi
On Sat, Jun 13, 2020 at 9:12 PM Mike Kravetz wrote: > > On 6/12/20 11:53 PM, Amir Goldstein wrote: > As a hugetlbfs developer, I do not know of a use case for interoperability > with overlayfs. So yes, I am not too interested in making them work well > together. However, if there was an actual

Re: [PATCH v4 1/2] hugetlb: use f_mode & FMODE_HUGETLBFS to identify hugetlbfs files

2020-06-13 Thread Mike Kravetz
On 6/12/20 11:53 PM, Amir Goldstein wrote: >>> Incidentally, can a hugetlbfs be a lower layer, while the upper one >>> is a normal filesystem? What should happen on copyup? >> >> Yes, that seems to work as expected. When accessed for write the hugetlb >> file is copied to the normal filesystem.

Re: [PATCH v4 1/2] hugetlb: use f_mode & FMODE_HUGETLBFS to identify hugetlbfs files

2020-06-13 Thread Matthew Wilcox
On Sat, Jun 13, 2020 at 09:53:24AM +0300, Amir Goldstein wrote: > Currently, the only in-tree stacking fs are overlayfs and ecryptfs, but there > are some out of tree implementations as well (shiftfs). > So you may only take that option if you do not care about the combination > of hugetlbfs with

Re: [PATCH v4 1/2] hugetlb: use f_mode & FMODE_HUGETLBFS to identify hugetlbfs files

2020-06-13 Thread Amir Goldstein
> > Incidentally, can a hugetlbfs be a lower layer, while the upper one > > is a normal filesystem? What should happen on copyup? > > Yes, that seems to work as expected. When accessed for write the hugetlb > file is copied to the normal filesystem. > > The BUG found by syzbot actually has a

Re: [PATCH v4 1/2] hugetlb: use f_mode & FMODE_HUGETLBFS to identify hugetlbfs files

2020-06-12 Thread Mike Kravetz
On 6/11/20 6:58 PM, Al Viro wrote: > On Thu, Jun 11, 2020 at 05:46:43PM -0700, Mike Kravetz wrote: >> The routine is_file_hugepages() checks f_op == hugetlbfs_file_operations >> to determine if the file resides in hugetlbfs. This is problematic when >> the file is on a union or overlay. Instead,

Re: [PATCH v4 1/2] hugetlb: use f_mode & FMODE_HUGETLBFS to identify hugetlbfs files

2020-06-11 Thread Al Viro
On Thu, Jun 11, 2020 at 05:46:43PM -0700, Mike Kravetz wrote: > The routine is_file_hugepages() checks f_op == hugetlbfs_file_operations > to determine if the file resides in hugetlbfs. This is problematic when > the file is on a union or overlay. Instead, define a new file mode >

Re: [PATCH v4 1/2] hugetlb: use f_mode & FMODE_HUGETLBFS to identify hugetlbfs files

2020-06-11 Thread Matthew Wilcox
On Thu, Jun 11, 2020 at 05:46:43PM -0700, Mike Kravetz wrote: > The routine is_file_hugepages() checks f_op == hugetlbfs_file_operations > to determine if the file resides in hugetlbfs. This is problematic when > the file is on a union or overlay. Instead, define a new file mode >

[PATCH v4 1/2] hugetlb: use f_mode & FMODE_HUGETLBFS to identify hugetlbfs files

2020-06-11 Thread Mike Kravetz
The routine is_file_hugepages() checks f_op == hugetlbfs_file_operations to determine if the file resides in hugetlbfs. This is problematic when the file is on a union or overlay. Instead, define a new file mode FMODE_HUGETLBFS which is set when a hugetlbfs file is opened. The mode can easily