[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200612015326.GD8681@bombadil.infradead.org>
Date: Thu, 11 Jun 2020 18:53:26 -0700
From: Matthew Wilcox <willy@...radead.org>
To: Mike Kravetz <mike.kravetz@...cle.com>
Cc: linux-mm@...ck.org, linux-fsdevel@...r.kernel.org,
overlayfs <linux-unionfs@...r.kernel.org>,
linux-kernel@...r.kernel.org, Al Viro <viro@...iv.linux.org.uk>,
Miklos Szeredi <miklos@...redi.hu>,
Colin Walters <walters@...bum.org>,
Andrew Morton <akpm@...ux-foundation.org>,
syzbot <syzbot+d6ec23007e951dadf3de@...kaller.appspotmail.com>,
syzkaller-bugs <syzkaller-bugs@...glegroups.com>
Subject: Re: [PATCH v4 1/2] hugetlb: use f_mode & FMODE_HUGETLBFS to identify
hugetlbfs files
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
> FMODE_HUGETLBFS which is set when a hugetlbfs file is opened. The mode
> can easily be copied to other 'files' derived from the original hugetlbfs
> file.
>
> With this change hugetlbfs_file_operations can be static as it should be.
>
> There is also a (duplicate) set of shm file operations used for the routine
> is_file_shm_hugepages(). Instead of setting/using special f_op's, just
> propagate the FMODE_HUGETLBFS mode. This means is_file_shm_hugepages() and
> the duplicate f_ops can be removed.
>
> While cleaning things up, change the name of is_file_hugepages() to
> is_file_hugetlbfs(). The term hugepages is a bit ambiguous.
I was going to have objections to this before I read it more carefully
and realised that the "shm" here is sysvipc and doesn't have anything
to do with the huge page support in shmfs.
> A subsequent patch will propagate FMODE_HUGETLBFS in overlayfs.
>
> Suggested-by: Al Viro <viro@...iv.linux.org.uk>
> Signed-off-by: Mike Kravetz <mike.kravetz@...cle.com>
Reviewed-by: Matthew Wilcox (Oracle) <willy@...radead.org>
I might have suggested splitting the rename of is_file_hugetlbfs() from
the rest of this patch, but I wouldn't resend to change that.
Powered by blists - more mailing lists