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 D4960C433E0 for ; Thu, 11 Jun 2020 00:37:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AFB4C2081A for ; Thu, 11 Jun 2020 00:37:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726986AbgFKAhq (ORCPT ); Wed, 10 Jun 2020 20:37:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44798 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726977AbgFKAhq (ORCPT ); Wed, 10 Jun 2020 20:37:46 -0400 Received: from ZenIV.linux.org.uk (zeniv.linux.org.uk [IPv6:2002:c35c:fd02::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 98B64C08C5C1; Wed, 10 Jun 2020 17:37:45 -0700 (PDT) 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: Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org 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.