From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8FF772C81 for ; Tue, 23 Nov 2021 22:54:31 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 3A7AF60F5D; Tue, 23 Nov 2021 22:54:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1637708071; bh=NYkX8UHWeP1OEOzoKcmsOPU82GrKW5S4+IZ7T4iz94Y=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=tXMKf7yMwweCOKAzEhfZayDcajvP1O2UdSzRfQBzFDtkQ3b0NxAgePyY/ApKecqJS QRl27OUtt8ygRdblDJxy//OCChxugex79UUdvMS9oPEY+UZnvM0n5uyVIcFA+Od7qH S9NBv+1Lq4LHL1ydTCM3aS1U3cu0vCnmWNqiAkrtW71TSqXMBfB9Rmco6uRNZ+fTYq AAyj38T84Zwq5VWYOhQdTQ72iFh3otPvctyg1hmLpjJEyn1+JrWa3ODOQwQN+ImZVJ 17HF6GW5sXzvWbqvXiEKycV9D8L76owqYREgiKs6ah7AFzGd2OAahNhBKJ4ki8RsHw 5IqICgEUzZAUw== Date: Tue, 23 Nov 2021 14:54:30 -0800 From: "Darrick J. Wong" To: Christoph Hellwig Cc: Dan Williams , Mike Snitzer , Ira Weiny , dm-devel@redhat.com, linux-xfs@vger.kernel.org, nvdimm@lists.linux.dev, linux-s390@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-erofs@lists.ozlabs.org, linux-ext4@vger.kernel.org, virtualization@lists.linux-foundation.org Subject: Re: [PATCH 20/29] ext4: cleanup the dax handling in ext4_fill_super Message-ID: <20211123225430.GN266024@magnolia> References: <20211109083309.584081-1-hch@lst.de> <20211109083309.584081-21-hch@lst.de> Precedence: bulk X-Mailing-List: nvdimm@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211109083309.584081-21-hch@lst.de> On Tue, Nov 09, 2021 at 09:33:00AM +0100, Christoph Hellwig wrote: > Only call fs_dax_get_by_bdev once the sbi has been allocated and remove > the need for the dax_dev local variable. > > Signed-off-by: Christoph Hellwig > --- > fs/ext4/super.c | 7 +++---- > 1 file changed, 3 insertions(+), 4 deletions(-) > > diff --git a/fs/ext4/super.c b/fs/ext4/super.c > index eb4df43abd76e..b60401bb1c310 100644 > --- a/fs/ext4/super.c > +++ b/fs/ext4/super.c > @@ -3879,7 +3879,6 @@ static void ext4_setup_csum_trigger(struct super_block *sb, > > static int ext4_fill_super(struct super_block *sb, void *data, int silent) > { > - struct dax_device *dax_dev = fs_dax_get_by_bdev(sb->s_bdev); > char *orig_data = kstrdup(data, GFP_KERNEL); > struct buffer_head *bh, **group_desc; > struct ext4_super_block *es = NULL; > @@ -3910,12 +3909,12 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) > if ((data && !orig_data) || !sbi) > goto out_free_base; > > - sbi->s_daxdev = dax_dev; > sbi->s_blockgroup_lock = > kzalloc(sizeof(struct blockgroup_lock), GFP_KERNEL); > if (!sbi->s_blockgroup_lock) > goto out_free_base; > > + sbi->s_daxdev = fs_dax_get_by_bdev(sb->s_bdev); > sb->s_fs_info = sbi; > sbi->s_sb = sb; > sbi->s_inode_readahead_blks = EXT4_DEF_INODE_READAHEAD_BLKS; > @@ -4300,7 +4299,7 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) > goto failed_mount; > } > > - if (dax_dev) { > + if (sbi->s_daxdev) { > if (blocksize == PAGE_SIZE) > set_bit(EXT4_FLAGS_BDEV_IS_DAX, &sbi->s_ext4_flags); > else > @@ -5096,10 +5095,10 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) > out_fail: > sb->s_fs_info = NULL; > kfree(sbi->s_blockgroup_lock); > + fs_put_dax(sbi->s_daxdev ); Nit: no space before the paren ^ here. With that fixed, Reviewed-by: Darrick J. Wong --D > out_free_base: > kfree(sbi); > kfree(orig_data); > - fs_put_dax(dax_dev); > return err ? err : ret; > } > > -- > 2.30.2 > 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 lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5435DC43219 for ; Tue, 23 Nov 2021 22:54:37 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4HzKG366l9z2ynQ for ; Wed, 24 Nov 2021 09:54:35 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=tXMKf7yM; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=kernel.org (client-ip=198.145.29.99; helo=mail.kernel.org; envelope-from=djwong@kernel.org; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=tXMKf7yM; dkim-atps=neutral Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4HzKG12tC3z2x99 for ; Wed, 24 Nov 2021 09:54:33 +1100 (AEDT) Received: by mail.kernel.org (Postfix) with ESMTPSA id 3A7AF60F5D; Tue, 23 Nov 2021 22:54:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1637708071; bh=NYkX8UHWeP1OEOzoKcmsOPU82GrKW5S4+IZ7T4iz94Y=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=tXMKf7yMwweCOKAzEhfZayDcajvP1O2UdSzRfQBzFDtkQ3b0NxAgePyY/ApKecqJS QRl27OUtt8ygRdblDJxy//OCChxugex79UUdvMS9oPEY+UZnvM0n5uyVIcFA+Od7qH S9NBv+1Lq4LHL1ydTCM3aS1U3cu0vCnmWNqiAkrtW71TSqXMBfB9Rmco6uRNZ+fTYq AAyj38T84Zwq5VWYOhQdTQ72iFh3otPvctyg1hmLpjJEyn1+JrWa3ODOQwQN+ImZVJ 17HF6GW5sXzvWbqvXiEKycV9D8L76owqYREgiKs6ah7AFzGd2OAahNhBKJ4ki8RsHw 5IqICgEUzZAUw== Date: Tue, 23 Nov 2021 14:54:30 -0800 From: "Darrick J. Wong" To: Christoph Hellwig Subject: Re: [PATCH 20/29] ext4: cleanup the dax handling in ext4_fill_super Message-ID: <20211123225430.GN266024@magnolia> References: <20211109083309.584081-1-hch@lst.de> <20211109083309.584081-21-hch@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211109083309.584081-21-hch@lst.de> X-BeenThere: linux-erofs@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development of Linux EROFS file system List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: nvdimm@lists.linux.dev, Mike Snitzer , linux-s390@vger.kernel.org, linux-erofs@lists.ozlabs.org, virtualization@lists.linux-foundation.org, linux-xfs@vger.kernel.org, dm-devel@redhat.com, linux-fsdevel@vger.kernel.org, Dan Williams , linux-ext4@vger.kernel.org, Ira Weiny Errors-To: linux-erofs-bounces+linux-erofs=archiver.kernel.org@lists.ozlabs.org Sender: "Linux-erofs" On Tue, Nov 09, 2021 at 09:33:00AM +0100, Christoph Hellwig wrote: > Only call fs_dax_get_by_bdev once the sbi has been allocated and remove > the need for the dax_dev local variable. > > Signed-off-by: Christoph Hellwig > --- > fs/ext4/super.c | 7 +++---- > 1 file changed, 3 insertions(+), 4 deletions(-) > > diff --git a/fs/ext4/super.c b/fs/ext4/super.c > index eb4df43abd76e..b60401bb1c310 100644 > --- a/fs/ext4/super.c > +++ b/fs/ext4/super.c > @@ -3879,7 +3879,6 @@ static void ext4_setup_csum_trigger(struct super_block *sb, > > static int ext4_fill_super(struct super_block *sb, void *data, int silent) > { > - struct dax_device *dax_dev = fs_dax_get_by_bdev(sb->s_bdev); > char *orig_data = kstrdup(data, GFP_KERNEL); > struct buffer_head *bh, **group_desc; > struct ext4_super_block *es = NULL; > @@ -3910,12 +3909,12 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) > if ((data && !orig_data) || !sbi) > goto out_free_base; > > - sbi->s_daxdev = dax_dev; > sbi->s_blockgroup_lock = > kzalloc(sizeof(struct blockgroup_lock), GFP_KERNEL); > if (!sbi->s_blockgroup_lock) > goto out_free_base; > > + sbi->s_daxdev = fs_dax_get_by_bdev(sb->s_bdev); > sb->s_fs_info = sbi; > sbi->s_sb = sb; > sbi->s_inode_readahead_blks = EXT4_DEF_INODE_READAHEAD_BLKS; > @@ -4300,7 +4299,7 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) > goto failed_mount; > } > > - if (dax_dev) { > + if (sbi->s_daxdev) { > if (blocksize == PAGE_SIZE) > set_bit(EXT4_FLAGS_BDEV_IS_DAX, &sbi->s_ext4_flags); > else > @@ -5096,10 +5095,10 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) > out_fail: > sb->s_fs_info = NULL; > kfree(sbi->s_blockgroup_lock); > + fs_put_dax(sbi->s_daxdev ); Nit: no space before the paren ^ here. With that fixed, Reviewed-by: Darrick J. Wong --D > out_free_base: > kfree(sbi); > kfree(orig_data); > - fs_put_dax(dax_dev); > return err ? err : ret; > } > > -- > 2.30.2 > 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 us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6BCA7C433EF for ; Tue, 23 Nov 2021 22:54:47 +0000 (UTC) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-597-ZHqa1_U2O6WrlclD3W4UaQ-1; Tue, 23 Nov 2021 17:54:43 -0500 X-MC-Unique: ZHqa1_U2O6WrlclD3W4UaQ-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 7392810144EC; Tue, 23 Nov 2021 22:54:38 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 574EA5FC13; Tue, 23 Nov 2021 22:54:38 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 2E1D81832E7F; Tue, 23 Nov 2021 22:54:38 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 1ANMsbZ7025811 for ; Tue, 23 Nov 2021 17:54:37 -0500 Received: by smtp.corp.redhat.com (Postfix) id 388712026D6A; Tue, 23 Nov 2021 22:54:37 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast02.extmail.prod.ext.rdu2.redhat.com [10.11.55.18]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 343CE2026D69 for ; Tue, 23 Nov 2021 22:54:34 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 48C078007B1 for ; Tue, 23 Nov 2021 22:54:34 +0000 (UTC) Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-525-0dD_Iua6PpqeFzKXElsVXA-1; Tue, 23 Nov 2021 17:54:32 -0500 X-MC-Unique: 0dD_Iua6PpqeFzKXElsVXA-1 Received: by mail.kernel.org (Postfix) with ESMTPSA id 3A7AF60F5D; Tue, 23 Nov 2021 22:54:31 +0000 (UTC) Date: Tue, 23 Nov 2021 14:54:30 -0800 From: "Darrick J. Wong" To: Christoph Hellwig Message-ID: <20211123225430.GN266024@magnolia> References: <20211109083309.584081-1-hch@lst.de> <20211109083309.584081-21-hch@lst.de> MIME-Version: 1.0 In-Reply-To: <20211109083309.584081-21-hch@lst.de> X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-loop: dm-devel@redhat.com Cc: nvdimm@lists.linux.dev, Mike Snitzer , linux-s390@vger.kernel.org, linux-erofs@lists.ozlabs.org, virtualization@lists.linux-foundation.org, linux-xfs@vger.kernel.org, dm-devel@redhat.com, linux-fsdevel@vger.kernel.org, Dan Williams , linux-ext4@vger.kernel.org, Ira Weiny Subject: Re: [dm-devel] [PATCH 20/29] ext4: cleanup the dax handling in ext4_fill_super X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dm-devel-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit On Tue, Nov 09, 2021 at 09:33:00AM +0100, Christoph Hellwig wrote: > Only call fs_dax_get_by_bdev once the sbi has been allocated and remove > the need for the dax_dev local variable. > > Signed-off-by: Christoph Hellwig > --- > fs/ext4/super.c | 7 +++---- > 1 file changed, 3 insertions(+), 4 deletions(-) > > diff --git a/fs/ext4/super.c b/fs/ext4/super.c > index eb4df43abd76e..b60401bb1c310 100644 > --- a/fs/ext4/super.c > +++ b/fs/ext4/super.c > @@ -3879,7 +3879,6 @@ static void ext4_setup_csum_trigger(struct super_block *sb, > > static int ext4_fill_super(struct super_block *sb, void *data, int silent) > { > - struct dax_device *dax_dev = fs_dax_get_by_bdev(sb->s_bdev); > char *orig_data = kstrdup(data, GFP_KERNEL); > struct buffer_head *bh, **group_desc; > struct ext4_super_block *es = NULL; > @@ -3910,12 +3909,12 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) > if ((data && !orig_data) || !sbi) > goto out_free_base; > > - sbi->s_daxdev = dax_dev; > sbi->s_blockgroup_lock = > kzalloc(sizeof(struct blockgroup_lock), GFP_KERNEL); > if (!sbi->s_blockgroup_lock) > goto out_free_base; > > + sbi->s_daxdev = fs_dax_get_by_bdev(sb->s_bdev); > sb->s_fs_info = sbi; > sbi->s_sb = sb; > sbi->s_inode_readahead_blks = EXT4_DEF_INODE_READAHEAD_BLKS; > @@ -4300,7 +4299,7 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) > goto failed_mount; > } > > - if (dax_dev) { > + if (sbi->s_daxdev) { > if (blocksize == PAGE_SIZE) > set_bit(EXT4_FLAGS_BDEV_IS_DAX, &sbi->s_ext4_flags); > else > @@ -5096,10 +5095,10 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) > out_fail: > sb->s_fs_info = NULL; > kfree(sbi->s_blockgroup_lock); > + fs_put_dax(sbi->s_daxdev ); Nit: no space before the paren ^ here. With that fixed, Reviewed-by: Darrick J. Wong --D > out_free_base: > kfree(sbi); > kfree(orig_data); > - fs_put_dax(dax_dev); > return err ? err : ret; > } > > -- > 2.30.2 > -- dm-devel mailing list dm-devel@redhat.com https://listman.redhat.com/mailman/listinfo/dm-devel