Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp3587733rdb; Wed, 13 Sep 2023 17:33:20 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFN8pKzcjYZ9pH0FBNYDg9r0tRmS2Nwumqi8kdhPNWjbqgPN4MQ8Uktx110BPf7qGp2l0V9 X-Received: by 2002:a17:90a:fe0a:b0:271:ab23:6288 with SMTP id ck10-20020a17090afe0a00b00271ab236288mr3658466pjb.14.1694651600452; Wed, 13 Sep 2023 17:33:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694651600; cv=none; d=google.com; s=arc-20160816; b=MhGMz9Xsp0mcuNhOs0huPsTBYspm2AIZ6C50WtmC+vxYEXSPQTgipdJ8HjKYsdvS+6 rN2vgwta1U9kA45cLG8F7lyPj5Dzvf0gdOUeed88DsFYDBmzZzoukWNPBsVJcK0lyXFF 3L4j5VVafE63dNHS/bRAuKaaO7jwgNGqok1BDhKQwhfdxFCuuF+o3Atx0vTZ+o1hsS9+ Il6xlJdlA5+wUNPR2lWsp8n/f0JKtufiWJECTbyPeeHP3pEquJR8QPdB12UeG5GvT76w JwnA/O2EVjB6o6Jy4OXAsrMbYm3pR8eAMmIqt+dQhgyyghk/S58CEIBdanP6QvVANSRm usPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :organization:from:references:cc:to:content-language:subject :user-agent:mime-version:date:message-id:dkim-signature; bh=Vk+E0ikKK9FXbe2kQzm5fZxgWYZlMzu9YZNYbEjzcmY=; fh=BstSWPKqOENnV2JziEpUAoWQPGPcn/o9H7ZjtrQl2Dc=; b=AOdQSRAV8tIrr9tRK3RhC6jB6G9GoeTYKRl1+Om6O7+RFVnUD+Xm43VauQHM+sS1Gu ROaWZ7p9862+lmUdTm3sh1rnzppY87BfJREMCBuexfNI393GIE1+1F3yKI1dS33kGxlg UQ6BqlpCsID/3rY6dBVYm+lL7UJ+6sMXS2C11f2zkgLWQb2Yt47yyeBSQUwW0fh8axwA bW4dAu0YYcK48DgfrjG/lzMXrw1smUQu6CBDPNKXJj4JD3kYixOKDVefUEWoeM55S+x6 KAtBnI9oaWyRTi+Ya6mBPO8zi5Iz6G1zC099haoHz6MpUtygOA4SmI+tM8HAt9QJTcc3 7cJQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=fsjRpDYS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id mh14-20020a17090b4ace00b002743618d4bcsi2851581pjb.101.2023.09.13.17.33.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Sep 2023 17:33:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=fsjRpDYS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 5EC5F82554AB; Wed, 13 Sep 2023 17:33:18 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233297AbjINAdM (ORCPT + 99 others); Wed, 13 Sep 2023 20:33:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47894 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231223AbjINAdL (ORCPT ); Wed, 13 Sep 2023 20:33:11 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EF2391724; Wed, 13 Sep 2023 17:33:07 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6ADC5C433C7; Thu, 14 Sep 2023 00:33:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1694651587; bh=78IdMo52kj5+6bJlcewfwBX0rNPqip7T68o37Qx9Yr4=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=fsjRpDYSulA9367EFdFAGLUTu0c9nlbpmTLnmUNUWF/Ujr/W3vhKnAVWmlRosElKt i4pEY8n18Q45chLu8k2MsnLto7mITLe3+uU4+oOGe0HUptveFjgJddRHFVT2qBJghq OW8Jj0CdSixK2KBDNQEO9ypNb/74gOs9KJjTtal3fzi9F0XVeh7th4ycIuM74sgwi/ zWy5vQt73rtL1m+kY5KAtchyeuTeCH6tQl9STxRRsALiOOAGTLQxoEOjCnbVdYKWKs NdpKSg+jPtGvbF6+MTJVGOypSsPATnvfVPeTuwDr0uPOGJocHhU7pykTWe9IyJ0i6G WFTiSHoplUEVQ== Message-ID: <36a333bf-4cc5-e3a6-90fd-34b362f96f83@kernel.org> Date: Thu, 14 Sep 2023 09:33:03 +0900 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PATCH 09/19] zonefs: remove duplicate cleanup in zonefs_fill_super Content-Language: en-US To: Christoph Hellwig , Christian Brauner , Al Viro Cc: Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Fenghua Yu , Reinette Chatre , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Dennis Dalessandro , Tejun Heo , Trond Myklebust , Anna Schumaker , Kees Cook , Naohiro Aota , Greg Kroah-Hartman , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org, linux-rdma@vger.kernel.org, linux-nfs@vger.kernel.org, linux-hardening@vger.kernel.org, cgroups@vger.kernel.org References: <20230913111013.77623-1-hch@lst.de> <20230913111013.77623-10-hch@lst.de> From: Damien Le Moal Organization: Western Digital Research In-Reply-To: <20230913111013.77623-10-hch@lst.de> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Wed, 13 Sep 2023 17:33:18 -0700 (PDT) X-Spam-Status: No, score=-2.7 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email On 9/13/23 20:10, Christoph Hellwig wrote: > When ->fill_super fails, ->kill_sb is called which already cleans up > the inodes and zgroups. > > Drop the extra cleanup code in zonefs_fill_super. > > Signed-off-by: Christoph Hellwig Looks good to me. Acked-by: Damien Le Moal > --- > fs/zonefs/super.c | 21 +++++---------------- > 1 file changed, 5 insertions(+), 16 deletions(-) > > diff --git a/fs/zonefs/super.c b/fs/zonefs/super.c > index 9d1a9808fbbba6..35b2554ce2ac2e 100644 > --- a/fs/zonefs/super.c > +++ b/fs/zonefs/super.c > @@ -1309,13 +1309,12 @@ static int zonefs_fill_super(struct super_block *sb, void *data, int silent) > /* Initialize the zone groups */ > ret = zonefs_init_zgroups(sb); > if (ret) > - goto cleanup; > + return ret; > > /* Create the root directory inode */ > - ret = -ENOMEM; > inode = new_inode(sb); > if (!inode) > - goto cleanup; > + return -ENOMEM; > > inode->i_ino = bdev_nr_zones(sb->s_bdev); > inode->i_mode = S_IFDIR | 0555; > @@ -1333,7 +1332,7 @@ static int zonefs_fill_super(struct super_block *sb, void *data, int silent) > > sb->s_root = d_make_root(inode); > if (!sb->s_root) > - goto cleanup; > + return -ENOMEM; > > /* > * Take a reference on the zone groups directory inodes > @@ -1341,19 +1340,9 @@ static int zonefs_fill_super(struct super_block *sb, void *data, int silent) > */ > ret = zonefs_get_zgroup_inodes(sb); > if (ret) > - goto cleanup; > - > - ret = zonefs_sysfs_register(sb); > - if (ret) > - goto cleanup; > - > - return 0; > - > -cleanup: > - zonefs_release_zgroup_inodes(sb); > - zonefs_free_zgroups(sb); > + return ret; > > - return ret; > + return zonefs_sysfs_register(sb); > } > > static struct dentry *zonefs_mount(struct file_system_type *fs_type, -- Damien Le Moal Western Digital Research