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=-0.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,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 B36E5C433DF for ; Thu, 11 Jun 2020 00:37:46 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 7ADFF206F7 for ; Thu, 11 Jun 2020 00:37:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7ADFF206F7 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=zeniv.linux.org.uk Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 1DEDF8D0053; Wed, 10 Jun 2020 20:37:46 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 18F358D004C; Wed, 10 Jun 2020 20:37:46 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0A5458D0053; Wed, 10 Jun 2020 20:37:46 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0216.hostedemail.com [216.40.44.216]) by kanga.kvack.org (Postfix) with ESMTP id E2A368D004C for ; Wed, 10 Jun 2020 20:37:45 -0400 (EDT) Received: from smtpin11.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id AAA723568 for ; Thu, 11 Jun 2020 00:37:45 +0000 (UTC) X-FDA: 76915068090.11.chin78_4f112ec26dcf Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin11.hostedemail.com (Postfix) with ESMTP id 812D0180FA286 for ; Thu, 11 Jun 2020 00:37:45 +0000 (UTC) X-HE-Tag: chin78_4f112ec26dcf X-Filterd-Recvd-Size: 2294 Received: from ZenIV.linux.org.uk (zeniv.linux.org.uk [195.92.253.2]) by imf43.hostedemail.com (Postfix) with ESMTP for ; Thu, 11 Jun 2020 00:37:45 +0000 (UTC) Received: from viro by ZenIV.linux.org.uk with local (Exim 4.93 #3 (Red Hat Linux)) id 1jjBDi-006jDe-TJ; Thu, 11 Jun 2020 00:37:27 +0000 Date: Thu, 11 Jun 2020 01:37:26 +0100 From: Al Viro To: Mike Kravetz Cc: Miklos Szeredi , kbuild test robot , kbuild-all@lists.01.org, Colin Walters , syzbot , Andrew Morton , Linux Memory Management List , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, syzkaller-bugs , overlayfs Subject: Re: [PATCH v2] ovl: provide real_file() and overlayfs get_unmapped_area() Message-ID: <20200611003726.GY23230@ZenIV.linux.org.uk> References: <4ebd0429-f715-d523-4c09-43fa2c3bc338@oracle.com> <202005281652.QNakLkW3%lkp@intel.com> <365d83b8-3af7-2113-3a20-2aed51d9de91@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 812D0180FA286 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 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.