Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp1175442ybg; Thu, 4 Jun 2020 03:04:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyQn9zXN/g1vByKEy9k+Inndyjzud4FRkcLIyvGI9saCcU1JPgmPD5SprqltcwEcK38u+Xt X-Received: by 2002:a17:906:940d:: with SMTP id q13mr3222924ejx.534.1591265096139; Thu, 04 Jun 2020 03:04:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591265096; cv=none; d=google.com; s=arc-20160816; b=x4JdQkbI51AlQh2pUhCAvJB239xpLp/d1zFQarl5Dyi/dDq3epeJyhImxWqVk7g0oF vVSBF8Z/0IVN1hY8XZqXiIx8QT08MuqDWP3oF/ymHvbnH1J7jo7kF5qDsDS13Cw4T5nh elKhnFlXML0UIz0X65tHNoGEdeZq9JfzUmRn4ckSSECyKuY17ZXoqI338qXn55bIbQdi RxTQ1IAawfObZzxJV5NVLC/Rzt8WpUlvrYtRNC+J22EzQCCDFbHl3ta7bgAJC9TtreOK f8StB+i6U37ojzCPyBXp70+d4sYLs94W9e8d63d/dfNboENPlaBYnjlqsQsSRw4vl+Do gxfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=zhAP4FrRDZrjypcHYBWPYi+wkv0jiWxIjMhRADC+Z5I=; b=MGxEo2U7oa9UWz8XUs0Lz+dhpqIN79kMYfmqIb89dP6Tqeu+mZJI31yeznJubEO0Td iBYgEaKpOxAsBr54z0zQGQ5k6yR9VMZ09V8bNkGEW7zEGEnBqR9ei3e/nMdjSAytczy4 3vS9vvmzStHP/jhQZSQe0GI29pPXyAWJ4mLKiEEhdQt9latf4Ox9wCK8G9rWeeQ65IPw bKO3IdN+MZFVaSOxOO47z5ApAqhIzw2tp70k3NQmrPNH2t/Cb13QyhWJhmhQSINal6GY eL4SIe6X1rPNOjfYNgmC/74wkrLOAI1flztZSKiV86fhYrMwu9vBy4dLIFQsY2BHwpDL dQBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=temperror (no key for signature) header.i=@szeredi.hu header.s=google header.b=gAJavElU; 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 s4si1425484edr.359.2020.06.04.03.04.33; Thu, 04 Jun 2020 03:04:56 -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; dkim=temperror (no key for signature) header.i=@szeredi.hu header.s=google header.b=gAJavElU; 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 S1728005AbgFDJRD (ORCPT + 99 others); Thu, 4 Jun 2020 05:17:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33226 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727925AbgFDJRC (ORCPT ); Thu, 4 Jun 2020 05:17:02 -0400 Received: from mail-ed1-x543.google.com (mail-ed1-x543.google.com [IPv6:2a00:1450:4864:20::543]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2C55EC03E96E for ; Thu, 4 Jun 2020 02:17:02 -0700 (PDT) Received: by mail-ed1-x543.google.com with SMTP id m21so4059882eds.13 for ; Thu, 04 Jun 2020 02:17:02 -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=M/wEeBiDrDM9gmdQd9O/gijCqPZqpOnv1LJ0x/9iKRAWlGDQbgv/UelfpHSJXHlEsj fKi8Pb+9aeluC2uoqmoI6POqB4o8PU8/qa3mV/lY6YR7Ty2lXOd5wUqO23kc9TAiFsJQ wRhEpxeBP0Vf2ji9dFeoG3JTK3vpUYm0UlgsBEZryn7+XWlx+io677EG9S8ALpyUXRUh ludFO9Pgajp0gbud1sRomUsZCgYDmgPwXuAuF01Jny/TQf4Ce+hHswNjLz5G0bjKS8d8 5q6SY/nXCvOMeRHC190xaS578SO/CajiHwD9OOf9dCIq/chZK71WULgwLHPGv+r84Sji 8Frg== X-Gm-Message-State: AOAM5316UG0wV9GyjPH6GVcwnhYs2cVyOiZrkW/7y8asJpaNAgvR+Rfe KVEqp9MoAnUO9GzLSxFJ8iA8kyh01SrKHm6JxUBIvw== 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" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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