Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp911862ybg; Wed, 10 Jun 2020 17:42:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzo6tQbma0ILv9+E0sO8CJ47SUcvXPDZKF7grgVr+Iu1ozfpa9bbEPjbNXZ/X4tCkrQuJfm X-Received: by 2002:a17:907:2162:: with SMTP id rl2mr5561784ejb.365.1591836136905; Wed, 10 Jun 2020 17:42:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591836136; cv=none; d=google.com; s=arc-20160816; b=ueJ0GMUsG2gToL/i3fdFaKXG65H6JQsE3ENx7ySDBQe8CL0Ilu94Vn38MQBEfmxQhy UoCCDJT7X9Lc3eMayKu+n01eLf548FQhQt51slTatkrxotlFx2ykdTjqiD4eusPDBh/2 wmEknGiuplcBTaJ2hLu8crDhZfJseNXaBgVGeQgi4NLFR3V3vFVEGFEUS4PxdRPEaVTE Rlr6RJvW/JopwCd499dybstUELCcZvU5LP08Z7FeG9VsnyLZTPqxjTxxUpMmejJlKp6M MutBzo11/PiKFQq+bQau3kdHTv7PBwykq7+HynI/+a7VwaLrVlKk+K73LpTV91HO6ruK FY5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=rKxQMP/d9XFAQydo9CvVP22pSHQ2Hb7nI/RXX1mI+/E=; b=FbgYpfz+UVaBHY6WwIfPCFnMKaWWxWfxeIvcDroHC/NBZ6nC+UYMXxR8XUc//OLryu XA38ZHPGt8ESSH54sM6AW3YCSIh6PgDuSEyeemQBrXkPq6TNMTwrdjFa/khNNiSoyMyO cUZfdx8Smf5qfGv13eOMFCAW0Qzum/FDcWOPv/h9rayybscSbZGZGRNzmLd4Kh5ZwgUt 6o5mIPPhWCRQfR108cQqhYy8JlhknFRUA+Z/kWM8RS9rPrdnkrvIMcUNS9p9FRpbaVAz OoQ55gPo4Z8BdUaMrAAN06eI/s78BrULx+TJcFatk/nH7chjLmo7FmY0HSoFfRAhkZAr sgSg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dr4si1168141ejc.239.2020.06.10.17.41.54; Wed, 10 Jun 2020 17:42:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727058AbgFKAhq (ORCPT + 99 others); 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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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.