[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200611013616.GM19604@bombadil.infradead.org>
Date: Wed, 10 Jun 2020 18:36:16 -0700
From: Matthew Wilcox <willy@...radead.org>
To: Al Viro <viro@...iv.linux.org.uk>
Cc: Mike Kravetz <mike.kravetz@...cle.com>,
Miklos Szeredi <miklos@...redi.hu>,
kbuild test robot <lkp@...el.com>, kbuild-all@...ts.01.org,
Colin Walters <walters@...bum.org>,
syzbot <syzbot+d6ec23007e951dadf3de@...kaller.appspotmail.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Linux Memory Management List <linux-mm@...ck.org>,
linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
syzkaller-bugs <syzkaller-bugs@...glegroups.com>,
overlayfs <linux-unionfs@...r.kernel.org>
Subject: Re: [PATCH v2] ovl: provide real_file() and overlayfs
get_unmapped_area()
On Thu, Jun 11, 2020 at 01:37:26AM +0100, Al Viro wrote:
> On Wed, Jun 10, 2020 at 05:13:52PM -0700, Mike Kravetz wrote:
>
> > To address this issue,
> > - Add a new file operation f_real while will return the underlying file.
> > Only overlayfs provides a function for this operation.
> > - Add a new routine real_file() which can be used by core code get an
> > underlying file.
> > - Update is_file_hugepages to get the real file.
>
> Egads... So to find out whether it's a hugetlb you would
> * check if a method is NULL
> * if not, call it
> * ... and check if the method table of the result is hugetlbfs one?
>
> Here's a radical suggestion: FMODE_HUGEPAGES. Just have it set by
> ->open() and let is_file_hugepages() check it. In ->f_mode. And
> make the bloody hugetlbfs_file_operations static, while we are at it.
ITYM FMODE_OVL_UPPER. To quote Mike:
> while (file->f_op == &ovl_file_operations)
> file = file->private_data;
> return file;
which would be transformed into:
while (file->f_mode & FMODE_OVL_UPPER)
file = file->private_data;
return file;
Or are you proposing that overlayfs copy FMODE_HUGEPAGES from the
underlying fs to the overlaying fs?
Powered by blists - more mailing lists