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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5CC10C4332F for ; Fri, 9 Dec 2022 05:39:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229754AbiLIFj3 (ORCPT ); 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> 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