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=-5.5 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham 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 E7A0BC433E0 for ; Thu, 4 Jun 2020 09:17:04 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 648F82074B for ; Thu, 4 Jun 2020 09:17:04 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="key not found in DNS" (0-bit key) header.d=szeredi.hu header.i=@szeredi.hu header.b="gAJavElU" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 648F82074B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=szeredi.hu Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id BE9D080007; Thu, 4 Jun 2020 05:17:03 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B99D28E0006; Thu, 4 Jun 2020 05:17:03 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A885580007; Thu, 4 Jun 2020 05:17:03 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0218.hostedemail.com [216.40.44.218]) by kanga.kvack.org (Postfix) with ESMTP id 8EBBC8E0006 for ; Thu, 4 Jun 2020 05:17:03 -0400 (EDT) Received: from smtpin14.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 49217A76E for ; Thu, 4 Jun 2020 09:17:03 +0000 (UTC) X-FDA: 76890975126.14.fowl37_205a2c8a63412 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin14.hostedemail.com (Postfix) with ESMTP id 2BC0E18229837 for ; Thu, 4 Jun 2020 09:17:03 +0000 (UTC) X-HE-Tag: fowl37_205a2c8a63412 X-Filterd-Recvd-Size: 5994 Received: from mail-ed1-f66.google.com (mail-ed1-f66.google.com [209.85.208.66]) by imf15.hostedemail.com (Postfix) with ESMTP for ; Thu, 4 Jun 2020 09:17:02 +0000 (UTC) Received: by mail-ed1-f66.google.com with SMTP id t21so1397919edr.12 for ; Thu, 04 Jun 2020 02:17:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=szeredi.hu; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=zhAP4FrRDZrjypcHYBWPYi+wkv0jiWxIjMhRADC+Z5I=; b=gAJavElU635AJKokbORkRDl2kDekyNy4u8CmFMidi8khzlpUxFcGRfzaeZ3Jgj9mOB 1+tKhkMzDGoDn2AGpuzJ0NsaB1c3+XFNNzAZKaQYHmNxgVeT+XUEk+2k16vEB2GOO7M3 yHp6Vl00koFbXurW03WpWE/JSwfPOtiGtfhvI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=zhAP4FrRDZrjypcHYBWPYi+wkv0jiWxIjMhRADC+Z5I=; b=RR62hkuS1XToNl6cWNQcsNZQkohKsN3eCC8MGqUdkdcx3DI9MCZwsbZriE82MK3aHO aZPatvLbLUaVZ7QiR+I/afz7thdkPZLTsv7JZMtf1IIE3UuHnOnFqVwk02WUGAju4nof MpJr4U2giBHYn920Dktw0+mn/lL3zBsRzwF5E0chuAF1dQ6NlzfCUG5nllw/xKPOmuqx OgGH+wvpQoXvzr4Q9kscCyJdVETEH8RnvAWB02CdLetbMYVr/KYItaUrG2Zrjb7+gDCV ONsVtXGqb+WbRNsFGPhzElUlzkxlsyfjXM+NVGP8vMtNNVuY1SEgnOqdRYYI0e/gV2z2 FiYg== X-Gm-Message-State: AOAM530gTN6uOaF6ecqJ4+6/Sekz9SVj9tDBSDhzIZ962VHN9HBqqia9 VrsafYSZ9v5+SEHmv6U8YHODgqnxDcT42IFDHzPz2A== X-Google-Smtp-Source: ABdhPJx61AOxmZRmL/Oy5iwZykzcL1rHsU7jxY58d6SBzKQDu9pppgd1wvMKOMT3TGbZI7nXAdbF8OSqjlU8BfXzx44= X-Received: by 2002:aa7:d785:: with SMTP id s5mr3554653edq.17.1591262220848; Thu, 04 Jun 2020 02:17:00 -0700 (PDT) MIME-Version: 1.0 References: <4ebd0429-f715-d523-4c09-43fa2c3bc338@oracle.com> <202005281652.QNakLkW3%lkp@intel.com> <365d83b8-3af7-2113-3a20-2aed51d9de91@oracle.com> In-Reply-To: <365d83b8-3af7-2113-3a20-2aed51d9de91@oracle.com> From: Miklos Szeredi Date: Thu, 4 Jun 2020 11:16:49 +0200 Message-ID: Subject: Re: [PATCH v2] ovl: provide real_file() and overlayfs get_unmapped_area() To: Mike Kravetz Cc: 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 , Al Viro , overlayfs Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 2BC0E18229837 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam03 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, May 28, 2020 at 11:01 PM Mike Kravetz wrote: > > On 5/28/20 1:37 AM, kbuild test robot wrote: > > Hi Mike, > > > > I love your patch! Yet something to improve: > > > > [auto build test ERROR on miklos-vfs/overlayfs-next] > > [also build test ERROR on linus/master v5.7-rc7] > > [cannot apply to linux/master next-20200526] > > [if your patch is applied to the wrong git tree, please drop us a note to help > > improve the system. BTW, we also suggest to use '--base' option to specify the > > base tree in git format-patch, please see https://stackoverflow.com/a/37406982] > > > > url: https://github.com/0day-ci/linux/commits/Mike-Kravetz/ovl-provide-real_file-and-overlayfs-get_unmapped_area/20200528-080533 > > base: https://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/vfs.git overlayfs-next > > config: h8300-randconfig-r036-20200528 (attached as .config) > > compiler: h8300-linux-gcc (GCC) 9.3.0 > > reproduce (this is a W=1 build): > > wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross > > chmod +x ~/bin/make.cross > > # save the attached .config to linux build tree > > COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=h8300 > > > > If you fix the issue, kindly add following tag as appropriate > > Reported-by: kbuild test robot > > > > All error/warnings (new ones prefixed by >>, old ones prefixed by <<): > > > > fs/overlayfs/file.c: In function 'ovl_get_unmapped_area': > >>> fs/overlayfs/file.c:768:14: error: 'struct mm_struct' has no member named 'get_unmapped_area' > > 768 | current->mm->get_unmapped_area)(realfile, > > | ^~ > >>> fs/overlayfs/file.c:770:1: warning: control reaches end of non-void function [-Wreturn-type] > > 770 | } > > | ^ > > > > vim +768 fs/overlayfs/file.c > > > > 760 > > 761 static unsigned long ovl_get_unmapped_area(struct file *file, > > 762 unsigned long uaddr, unsigned long len, > > 763 unsigned long pgoff, unsigned long flags) > > 764 { > > 765 struct file *realfile = real_file(file); > > 766 > > 767 return (realfile->f_op->get_unmapped_area ?: > > > 768 current->mm->get_unmapped_area)(realfile, > > 769 uaddr, len, pgoff, flags); > > > 770 } > > 771 > > > > --- > > 0-DAY CI Kernel Test Service, Intel Corporation > > https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org > > > > Well yuck! get_unmapped_area is not part of mm_struct if !CONFIG_MMU. > > Miklos, would adding '#ifdef CONFIG_MMU' around the overlayfs code be too > ugly for you? Another option is to use real_file() in the mmap code as > done in [1]. I think the proper fix is to add an inline helper (call_get_unmapped_area()?) in linux/mm.h, and make that work properly for the NOMMU case as well. Thanks, Miklos