Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2178785rwb; Thu, 8 Dec 2022 21:39:46 -0800 (PST) X-Google-Smtp-Source: AA0mqf5fMmd2MQWR2od1qwe9y5AUpSHtCpRGDW623uN+89ek27fxhrJJ0fqDRsIKfLa95zgqAW2J X-Received: by 2002:a05:6a21:9186:b0:a3:bdf6:3977 with SMTP id tp6-20020a056a21918600b000a3bdf63977mr5498575pzb.54.1670564386681; Thu, 08 Dec 2022 21:39:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670564386; cv=none; d=google.com; s=arc-20160816; b=QXdgpdw3PQW0ulQhqGLue+7oTck0SyQ4up5lIdz+JphXdmyebZUgcbiCzqR4eGFYku VCDfLfQgwchoiDzI32QRojaChXr9/isBossfZRfHtU23BAAihZw/SC52E/SVSIXixe1/ CWqnTpjAruDL3GLHFJFDM9Vel2mDcxCM3Q+ERk51PKD+Wf4IkTGRfeVNYrG93zaJnKRW wnhKuZzmcEjE8e3QvSPTbgCTP1U6D/HC3D5gNG5duulsDThlKLC6BLfzM8IM2f3N73kz Ckpoe+Y2E0Zpj2DbmVDDD21Pw0a0BCLCkNhGxWDXt7AhhH440itjchAiXSY0JQOAH63J KI+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=HbOe65ehHP3ho/xcnqRX2wOXeVegN7BlodoWL8v+7KQ=; b=bB8YS0yUMyrcrCWYJbYTBOPXnoHBCP5O5LcTolHrnDHtBhRN5z9+A/833jCGU8PT2F u56vUGVeasjHQTRU1dTGKpVcBbSjBF2oWRvdkoM0CliJsVDkM0mmnUmJcvUjfkzklpEt LO6W3T75UmwOGfKiTa0zRokoLTukQmdwM2CJBvA5HMsdTV7PZpLgwhT2rSjb7sWu2f3I 2o6/IESnLziCLJ/+Uh2J8RWmCed6wgfshUCYit8wL30XsfJylRw20iqAok2BawZGY3oD HZ+pl1vCWBluwM9jspX7dSh7gOU9uSHxsvrz12i71nnsK3oodTuFF5JPQoBE2MN39ze7 helw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mit.edu header.s=outgoing header.b=CMnEoz2v; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mit.edu Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u20-20020a634714000000b0047839ae135csi647189pga.434.2022.12.08.21.39.33; Thu, 08 Dec 2022 21:39:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail header.i=@mit.edu header.s=outgoing header.b=CMnEoz2v; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mit.edu Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229723AbiLIFj3 (ORCPT + 99 others); Fri, 9 Dec 2022 00:39:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58340 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229619AbiLIFj2 (ORCPT ); Fri, 9 Dec 2022 00:39:28 -0500 Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7EFB571248 for ; Thu, 8 Dec 2022 21:39:27 -0800 (PST) Received: from cwcc.thunk.org (pool-173-48-120-46.bstnma.fios.verizon.net [173.48.120.46]) (authenticated bits=0) (User authenticated as tytso@ATHENA.MIT.EDU) by outgoing.mit.edu (8.14.7/8.12.4) with ESMTP id 2B95dCwN023386 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 9 Dec 2022 00:39:13 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mit.edu; s=outgoing; t=1670564354; bh=HbOe65ehHP3ho/xcnqRX2wOXeVegN7BlodoWL8v+7KQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=CMnEoz2vt50OiReyoeE9YmSGvwOKfAVupdK5nUMMpoQxhnC+Wk17EyH8e/TBiJSbH a/uHPgGwkz1PicT8Dy4lyhOt2TlIWES1kd6R4ox/iaz/m5xXl10PCtV4wwCGs0KUSV 2to5yVeOmDfDlpyVuxhAzjQsKGhhzg7h09BJJh/zcsmrYrpn3QIQLEZEcyRslE17vy 6XisF8mZucJ96VfQikLDxpptLHHrPVeoKRCtm1jYUrq9eE+1TT2AdO3rg81QB6ONoz 1jKvj0M2H8qS8dcAcmQuWimroLtrjtJWu4GhUnBD2BcX6rx6JqqiF3NauCdc0SCGye yXESIFn9DbnBQ== Received: by cwcc.thunk.org (Postfix, from userid 15806) id B042B15C3AE9; Fri, 9 Dec 2022 00:39:12 -0500 (EST) Date: Fri, 9 Dec 2022 00:39:12 -0500 From: "Theodore Ts'o" To: Ye Bin Cc: adilger.kernel@dilger.ca, linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org, jack@suse.cz, Ye Bin Subject: Re: [PATCH v3 4/4] ext4: fix inode leak in 'ext4_xattr_inode_create()' Message-ID: References: <20221208023233.1231330-1-yebin@huaweicloud.com> <20221208023233.1231330-5-yebin@huaweicloud.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221208023233.1231330-5-yebin@huaweicloud.com> X-Spam-Status: No, score=-4.0 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Thu, Dec 08, 2022 at 10:32:33AM +0800, Ye Bin wrote: > From: Ye Bin > > There is issue as follows when do setxattr with inject fault: > [localhost]#fsck.ext4 -fn /dev/sda > e2fsck 1.46.6-rc1 (12-Sep-2022) > Pass 1: Checking inodes, blocks, and sizes > Pass 2: Checking directory structure > Pass 3: Checking directory connectivity > Pass 4: Checking reference counts > Unattached zero-length inode 15. Clear? no > > Unattached inode 15 > Connect to /lost+found? no > > Pass 5: Checking group summary information > > /dev/sda: ********** WARNING: Filesystem still has errors ********** > > /dev/sda: 15/655360 files (0.0% non-contiguous), 66755/2621440 blocks > > This occurs in 'ext4_xattr_inode_create()'. If 'ext4_mark_inode_dirty()' > fails, dropping i_nlink of the inode is needed. Or will lead to inode leak. > > Signed-off-by: Ye Bin > Reviewed-by: Jan Kara Applied, thanks. - Ted