Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp116289ybg; Thu, 11 Jun 2020 19:03:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyWx+r05qJsD7R8abudqOt+Dq1s+iJpMMSQID92ERnS6Yw3OmYg09C36W9hQ+qOMRQhHced X-Received: by 2002:a50:cd56:: with SMTP id d22mr9303012edj.374.1591927390657; Thu, 11 Jun 2020 19:03:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591927390; cv=none; d=google.com; s=arc-20160816; b=eb+erUWBeRVxfk3lbOazDJRFoYpvHZHhdznTZboXxTibSsARAGEhrMCLUbiAJMLuFH QbVoyF77SYbpLN9CfCm7E+Af02biiEo05B1TYUedhekcEqBWoDSL6aH07H3H4s2/lKs1 z59CCDfBwNzexnc1qGrCKpe7l4yoHAy95H4V7Oz3AAIujNvFam/lRNJa5keW/j8dnc4K IuqvwuCbnU8P5aD+1dOlHvAiv/BMz8prSEBLpoGeVAgRb096pecBRi5MER7X19kNKjVT 8OpTl9OKMoDmFXho9t+O+eAyKGrwKIQDi5KnLEHFi7qY+SZR1xfPhFlh9uQtkj+lc38Z ufLg== 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=gcIH4SHqc+3gdAOeSLwd0sWWoVr50Mvt2DYsHZf4Z80=; b=PXXKo5w2BvBo1UQB7gFqlm2k7kVuifw5syKPI/Whc/9gZayp4wih62XJ3exjIyG3Co ai03mI60IsMDkI+KYTbXgOfz8ymogPEp1jN0oyByOwhDp2qsVoK8B9TL/sWqdDPyiWJ0 pp0BQKvGlEuX325p0DNSU68uuKPwV7Nc7N4uO9mdwJRdKT0s1WOVhFL83tvKjkpCAR0z hquJofLX7UbQaZNIZyTC5EpnY18CTPXOcBdUncEZrc0zAcN7bCdUbpdNF0c0p5tGSKDJ ze6In0DIpNJeiqquLXXhkG7zQ4h9JFM+6pgC9kIqhpfom5oZ1sZmpQR3gLD40mMmhkl7 dY8g== 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 qw12si3000126ejb.492.2020.06.11.19.02.46; Thu, 11 Jun 2020 19:03:10 -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 S1726364AbgFLB6x (ORCPT + 99 others); Thu, 11 Jun 2020 21:58:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53306 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725796AbgFLB6x (ORCPT ); Thu, 11 Jun 2020 21:58:53 -0400 Received: from ZenIV.linux.org.uk (zeniv.linux.org.uk [IPv6:2002:c35c:fd02::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 03143C03E96F; Thu, 11 Jun 2020 18:58:52 -0700 (PDT) Received: from viro by ZenIV.linux.org.uk with local (Exim 4.93 #3 (Red Hat Linux)) id 1jjYxu-007MwO-TA; Fri, 12 Jun 2020 01:58:42 +0000 Date: Fri, 12 Jun 2020 02:58:42 +0100 From: Al Viro To: Mike Kravetz Cc: linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, overlayfs , linux-kernel@vger.kernel.org, Miklos Szeredi , Matthew Wilcox , 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: <20200612015842.GC23230@ZenIV.linux.org.uk> 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> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. s/HUGETLBFS/HUGEPAGES/, please. > While cleaning things up, change the name of is_file_hugepages() to > is_file_hugetlbfs(). The term hugepages is a bit ambiguous. Don't, especially since the very next patch adds such on overlayfs... Incidentally, can a hugetlbfs be a lower layer, while the upper one is a normal filesystem? What should happen on copyup?