Received: by 10.213.65.68 with SMTP id h4csp1356041imn; Sat, 24 Mar 2018 10:24:50 -0700 (PDT) X-Google-Smtp-Source: AG47ELvhiE8Ns3xhED18w73R/04RKKppqE57To7+i723QhNgij+opUfnYQcoJeLYHcLIrsLBZHEX X-Received: by 2002:a17:902:28c4:: with SMTP id f62-v6mr13613572plb.19.1521912290090; Sat, 24 Mar 2018 10:24:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521912290; cv=none; d=google.com; s=arc-20160816; b=xHI+eoBCifsA7jsUDFq/jcfF4yQ35l/ID4iIWLai7/gV7Bd9e2FxIuryMR5sx07xx0 wJuiqodphGmKk4XIlK8rCGprQagkB9lo1nL6kqYbDnqtPOVh9+nSuskfuo9k10OQSNZd H1EDA5zsZ1NJhJ0KqU8oHXsWZEJoLOULJE985HsAQa/FuA/gOeBrEzaAWIt9kL+0qCyK EOWtLD7/YjvnlGvtXxdUoPV9PjpDpZXxRVheCb8lMmaJKdXOWNvmWSce6xoz5inlBIap 13dX4sR1d+c8mr2ikCHH+dM+e8WrY71Tny1qST3UUHym6kgxyNKov6DNB2z+lhlXCeQy 27zg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=V/lTROjooZCJYXO3IaZumeJSPCiICzpcq/2RWXl2OYE=; b=DWUZ7NKfu/j4z0TbtPlF0wDR7JwetFuoiU18xa7kK5AKATrhUNh1jPdtCZpkIom1tA WGZ5CbZBRgsJdq+r+LPCPt+B3+IiMkBhKgRBHbNPb9aOQTgrKXeJnk576GE/jkJKfQuP iZT4k8ce9hEr3lOo9f0VnNkPnfA4Yv4OInZuY1ZBJ4kEUObmmGMXigLknUzAeGOERqe0 co6eJp/hGSLjig/6yl86yu1OF388DRWBnQ0OWHbAMXyAEilLFIyaXzovS3MoDuA2DKwx U+lLTevtnEyYzeoW6iX8AvKH9BRN1SOh2nIE+k/hcqySzA6FBNWqnVSQMEWMythF3bTz ng/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=PIKrh5Cu; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h80si8998074pfd.260.2018.03.24.10.24.35; Sat, 24 Mar 2018 10:24:50 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=PIKrh5Cu; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752629AbeCXRW1 (ORCPT + 99 others); Sat, 24 Mar 2018 13:22:27 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:45950 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752400AbeCXRWZ (ORCPT ); Sat, 24 Mar 2018 13:22:25 -0400 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w2OHLhp1133634; Sat, 24 Mar 2018 17:22:04 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=corp-2017-10-26; bh=V/lTROjooZCJYXO3IaZumeJSPCiICzpcq/2RWXl2OYE=; b=PIKrh5CuE4rA2h6lP29RWDsYMeCIbbE/DsUzRmMjOYix8lfk7lMIp1PNWoimTOTN0rb9 UuGKCw8/S7z8Lx+p1xnVhDpgWjOirs3VnQa/KxISRxgkdssgNxxQ+pNj1KCP4KyVOr9c pT+OivcGZmNPia/FtwQI6y7UKvnpIAcpArWo3Z4xMEeqwoS0ljcVDrbNHc4rboZB8cON i2UylAL4XdWapZNiZDZPPALbY3u0Cx1XAefQcRJ6U8L1pALghT+Zkn0fvGezaMtPx/Vx ZkCbVd/UEOKrCaX273no1EXaSoXN3h0sX5pbKRy70zG0Ba4KZ+T5Ue9CyLJ/phMD9xU/ Vw== Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp2120.oracle.com with ESMTP id 2gwu0f0019-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 24 Mar 2018 17:22:04 +0000 Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w2OHM3fv032472 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 24 Mar 2018 17:22:03 GMT Received: from ubhmp0007.oracle.com (ubhmp0007.oracle.com [156.151.24.60]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w2OHM0wm029064; Sat, 24 Mar 2018 17:22:00 GMT Received: from localhost (/67.169.218.210) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sat, 24 Mar 2018 17:22:00 +0000 Date: Sat, 24 Mar 2018 10:21:59 -0700 From: "Darrick J. Wong" To: Greg Kroah-Hartman Cc: "Luis R. Rodriguez" , Christoph Hellwig , xfs , linux-kernel@vger.kernel.org, Sasha Levin , Julia Lawall , Josh Triplett , Takashi Iwai , Michal Hocko , Joerg Roedel Subject: Re: [PATCH] xfs: always free inline data before resetting inode fork during ifree Message-ID: <20180324172159.GR4818@magnolia> References: <20171123060137.GL2135@magnolia> <20180323013037.GA9190@wotan.suse.de> <20180323034145.GH4818@magnolia> <20180323170813.GD30543@wotan.suse.de> <20180323172620.GK4818@magnolia> <20180323182302.GB9190@wotan.suse.de> <20180324090638.GB1170@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180324090638.GB1170@kroah.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8841 signatures=668695 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=9 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1803240202 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Mar 24, 2018 at 10:06:38AM +0100, Greg Kroah-Hartman wrote: > On Fri, Mar 23, 2018 at 06:23:02PM +0000, Luis R. Rodriguez wrote: > > On Fri, Mar 23, 2018 at 10:26:20AM -0700, Darrick J. Wong wrote: > > > On Fri, Mar 23, 2018 at 05:08:13PM +0000, Luis R. Rodriguez wrote: > > > > On Thu, Mar 22, 2018 at 08:41:45PM -0700, Darrick J. Wong wrote: > > > > > On Fri, Mar 23, 2018 at 01:30:37AM +0000, Luis R. Rodriguez wrote: > > > > > > On Wed, Nov 22, 2017 at 10:01:37PM -0800, Darrick J. Wong wrote: > > > > > > > diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c > > > > > > > index 61d1cb7..8012741 100644 > > > > > > > --- a/fs/xfs/xfs_inode.c > > > > > > > +++ b/fs/xfs/xfs_inode.c > > > > > > > @@ -2401,6 +2401,24 @@ xfs_ifree_cluster( > > > > > > > } > > > > > > > > > > > > > > /* > > > > > > > + * Free any local-format buffers sitting around before we reset to > > > > > > > + * extents format. > > > > > > > + */ > > > > > > > +static inline void > > > > > > > +xfs_ifree_local_data( > > > > > > > + struct xfs_inode *ip, > > > > > > > + int whichfork) > > > > > > > +{ > > > > > > > + struct xfs_ifork *ifp; > > > > > > > + > > > > > > > + if (XFS_IFORK_FORMAT(ip, whichfork) != XFS_DINODE_FMT_LOCAL) > > > > > > > + return; > > > > > > > > > > > > I'm new to all this so this was a bit hard to follow. I'm confused with how > > > > > > commit 43518812d2 ("xfs: remove support for inlining data/extents into the > > > > > > inode fork") exacerbated the leak, isn't that commit about > > > > > > XFS_DINODE_FMT_EXTENTS? > > > > > > > > > > Not specifically _EXTENTS, merely any fork (EXTENTS or LOCAL) whose > > > > > incore data was small enough to fit in if_inline_ata. > > > > > > > > Got it, I thought those were XFS_DINODE_FMT_EXTENTS by definition. > > > > > > > > > > Did we have cases where the format was XFS_DINODE_FMT_LOCAL and yet > > > > > > ifp->if_u1.if_data == ifp->if_u2.if_inline_data ? > > > > > > > > > > An empty directory is 6 bytes, which is what you get with a fresh mkdir > > > > > or after deleting everything in the directory. Prior to the 43518812d2 > > > > > patch we could get away with not even checking if we had to free if_data > > > > > when deleting a directory because it fit within if_inline_data. > > > > > > > > Ah got it. So your fix *is* also applicable even prior to commit 43518812d2. > > > > > > You'd have to modify the patch so that it doesn't try to kmem_free > > > if_data if if_data == if_inline_data but otherwise (in theory) I think > > > that the concept applies to pre-4.15 kernels. > > > > > > (YMMV, please do run this through QA/kmemleak just in case I'm wrong, etc...) > > > > Well... so we need a resolution and better get testing this already given that > > *I believe* the new auto-selection algorithm used to cherry pick patches onto > > stable for linux-4.14.y (covered on a paper [0] and when used, stable patches > > are prefixed with AUTOSEL, a recent discussion covered this in November 2017 > > [1]) recommended to merge your commit 98c4f78dcdd8 ("xfs: always free inline > > data before resetting inode fork during ifree") as stable commit 1eccdbd4836a41 > > on v4.14.17 *without* merging commit 43518812d2 ("xfs: remove support for > > inlining data/extents into the inode fork"). > > > > Sasha, Greg, > > > > Can you confirm if the algorithm was used in this case? > > No idea. > > I think xfs should just be added to the "blacklist" so that it is not > even looked at for these types of auto-selected patches. Much like the > i915 driver currently is handled (it too is ignored for these patches > due to objections from the maintainers of it.) Just out of curiosity, how does this autoselection mechanism work today? If it's smart enough to cherry pick patches, apply them to a kernel, build the kernel and run xfstests, and propose the patches if nothing weird happened, then I'd be interested in looking further. I've nothing against algorithmic selection per se, but I'd want to know more about the data sets and parameters that feed the algorithm. I did receive the AUTOSEL tagged patches a few days ago, but I couldn't figure out what automated regression testing, if any, had been done; or whether the patch submission was asking if we wanted it put into 4.14 or if it was a declaration that they were on their way in. Excuse me for being behind the times, but I'd gotten accustomed xfs patches only ending up in the stable kernels because we'd deliberately put them there. :) If blacklisting xfs is more convenient then I'm happy to continue things as they were. --D > thanks, > > greg k-h > -- > To unsubscribe from this list: send the line "unsubscribe linux-xfs" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html