From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.5 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 275CDC433E1 for ; Fri, 12 Jun 2020 01:53:32 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id BD79020842 for ; Fri, 12 Jun 2020 01:53:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="PDm/mf4V" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BD79020842 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 23DEE6B00F9; Thu, 11 Jun 2020 21:53:31 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1EE978D00A0; Thu, 11 Jun 2020 21:53:31 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0DD306B00FB; Thu, 11 Jun 2020 21:53:31 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0151.hostedemail.com [216.40.44.151]) by kanga.kvack.org (Postfix) with ESMTP id E7D186B00F9 for ; Thu, 11 Jun 2020 21:53:30 -0400 (EDT) Received: from smtpin19.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id A93C0356E for ; Fri, 12 Jun 2020 01:53:30 +0000 (UTC) X-FDA: 76918887780.19.space03_620526a26dd8 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin19.hostedemail.com (Postfix) with ESMTP id 76C4D1ACEA4 for ; Fri, 12 Jun 2020 01:53:30 +0000 (UTC) X-HE-Tag: space03_620526a26dd8 X-Filterd-Recvd-Size: 3453 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf16.hostedemail.com (Postfix) with ESMTP for ; Fri, 12 Jun 2020 01:53:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=cStLTJ8R6X6N3Wfmxkjdz1h2n4pTx9jO+4oGXH0Nk+U=; b=PDm/mf4V+mea+4FjDe9dRrySZm 1PQV3PkeeQydNP0pEbEeydYpOY6TBnb2aN5XtKW36ybqCahPFDrhLIL5/oWZUkM5bRvsJ1Ifi/or5 tRjIh2i9o8LjPat8GBLJCVjy+ZXRuXuVRQEApCSttRtSOkb4vn/HPp4qvsqxRlR/F3ecIywg7kqyF txNyAEzHkHeRDNdn8Cawq2zCu7aKl1akzpcC4Na5Hb1vFMhd8KYT2q3VT2KgEMFvntgbwR9njMPya 6k4fa/2vy1OZL+dcZR1YbRQ3rh1E1XN5Kk8SCNfSQXHbHkyYsjANp/wFk115nRsi2VRZE7HG7iUEW bssQishg==; Received: from willy by bombadil.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1jjYso-0006WI-Ve; Fri, 12 Jun 2020 01:53:26 +0000 Date: Thu, 11 Jun 2020 18:53:26 -0700 From: Matthew Wilcox To: Mike Kravetz Cc: linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, overlayfs , linux-kernel@vger.kernel.org, Al Viro , Miklos Szeredi , Colin Walters , Andrew Morton , syzbot , syzkaller-bugs Subject: Re: [PATCH v4 1/2] hugetlb: use f_mode & FMODE_HUGETLBFS to identify hugetlbfs files Message-ID: <20200612015326.GD8681@bombadil.infradead.org> References: <20200612004644.255692-1-mike.kravetz@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200612004644.255692-1-mike.kravetz@oracle.com> X-Rspamd-Queue-Id: 76C4D1ACEA4 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam04 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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 > Signed-off-by: Mike Kravetz Reviewed-by: Matthew Wilcox (Oracle) 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.