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.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (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 7BC5CEB64DC for ; Tue, 11 Jul 2023 16:18:09 +0000 (UTC) Received: from [127.0.0.1] (helo=sfs-ml-1.v29.lw.sourceforge.com) by sfs-ml-1.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1qJG40-0004QF-6J; Tue, 11 Jul 2023 16:18:09 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-1.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1qJG3z-0004Q9-69 for linux-f2fs-devel@lists.sourceforge.net; Tue, 11 Jul 2023 16:18:08 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=In-Reply-To:Content-Type:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=YKOwq8sdF95jVkTlVFJ5Q7JfTyV7gMWc0poo8VC6kiE=; b=MhkqYxepRd3xuCqOoqY7TgVD6M inh9E16OG2yM0IeaRZXvFHLd3MkyeDTaSUnpmC2hwKhvaRbDWKJj5MiecwO1tjpxpqCha9E/4Kfwa 9F2R9eJUWMmXKKN2xbJbg12aZL0GDgG9PlBxdd9IA3DRPPK1O9iBJ2aku1jqf0Ww02Hg=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To :From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=YKOwq8sdF95jVkTlVFJ5Q7JfTyV7gMWc0poo8VC6kiE=; b=T2NHFa1VuskbYP6JCVQT5ttlQ1 6sr0aQYjnKKzKJMD6L1EbI5AlVO0ugR8bAjVcF//4kGPg2K7J16Fv6q9Q1x9Auw16aZEvvLXrUx0I 04dqKO+ryrPU7ASKRruuieBJku5x2xwjnFldb8Ner1drh1fQqzk4I2iDoefJTkMsyZ64=; Received: from dfw.source.kernel.org ([139.178.84.217]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1qJG3z-0000sJ-Uo for linux-f2fs-devel@lists.sourceforge.net; Tue, 11 Jul 2023 16:18:07 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 6E91061557; Tue, 11 Jul 2023 16:18:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A0E1FC43397; Tue, 11 Jul 2023 16:17:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1689092279; bh=9L6KVSpQ52iJPE/W9jY3lrnhEPrff+Z1LTyLQcv3sdo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=GjMT73AgXcyF+/wnM61zc+wcm/8+eqcyrwD4iVIc+yIvuT+1V7qmm2MdRA0lKY/WD xdJ9bIgeszZQ6thQC1dB813TOS+iQrY0gKWqpajt4w0UqMTyhIgJcCUXMiuNqoFvgr wnTKYlRQKa4jrojQp05SGNSzG7uNhVVs+BgMkx/U6TNOu8WX1gyvrEsiYs0NfLPOiG N3frObkHFygc1ageTo9HcPRYpB6WWShpwoY0d1lOAkJJ2Et+mbfB3cECwz1PVy80tN 9hx8J+DBW/XxqyR1TilaseDsC9Ig0lMUv3olAUi58RZ19k/PcdKY/mt034voSdWvPO xq2nYnt433w4g== Date: Tue, 11 Jul 2023 09:17:57 -0700 From: Jaegeuk Kim To: Christoph Hellwig Message-ID: References: <20230707094028.107898-1-hch@lst.de> <20230711050101.GA19128@lst.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20230711050101.GA19128@lst.de> X-Headers-End: 1qJG3z-0000sJ-Uo Subject: Re: [f2fs-dev] [PATCH] f2fs: don't reopen the main block device in f2fs_scan_devices X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-block@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net On 07/11, Christoph Hellwig wrote: > I think that's because it doesn't look at sbi->s_ndevs in > destroy_device_list. Let's try the variant below, which also fixes > the buildbot warning for non-zoned configfs: Thanks. At a glance, this looks better. Let me give it a try. > > --- > >From 645d8dceaa97b6ee73be067495b111b15b187498 Mon Sep 17 00:00:00 2001 > From: Christoph Hellwig > Date: Fri, 7 Jul 2023 10:31:49 +0200 > Subject: f2fs: don't reopen the main block device in f2fs_scan_devices > > f2fs_scan_devices reopens the main device since the very beginning, which > has always been useless, and also means that we don't pass the right > holder for the reopen, which now leads to a warning as the core super.c > holder ops aren't passed in for the reopen. > > Fixes: 3c62be17d4f5 ("f2fs: support multiple devices") > Fixes: 0718afd47f70 ("block: introduce holder ops") > Signed-off-by: Christoph Hellwig > --- > block/blk-flush.c | 2 +- > fs/f2fs/super.c | 20 ++++++++------------ > 2 files changed, 9 insertions(+), 13 deletions(-) > > diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c > index ca31163da00a55..30883beb750a59 100644 > --- a/fs/f2fs/super.c > +++ b/fs/f2fs/super.c > @@ -1561,7 +1561,8 @@ static void destroy_device_list(struct f2fs_sb_info *sbi) > int i; > > for (i = 0; i < sbi->s_ndevs; i++) { > - blkdev_put(FDEV(i).bdev, sbi->sb->s_type); > + if (i > 0) > + blkdev_put(FDEV(i).bdev, sbi->sb->s_type); > #ifdef CONFIG_BLK_DEV_ZONED > kvfree(FDEV(i).blkz_seq); > #endif > @@ -4190,16 +4191,12 @@ static int f2fs_scan_devices(struct f2fs_sb_info *sbi) > sbi->aligned_blksize = true; > > for (i = 0; i < max_devices; i++) { > - > - if (i > 0 && !RDEV(i).path[0]) > + if (i == 0) > + FDEV(0).bdev = sbi->sb->s_bdev; > + else if (!RDEV(i).path[0]) > break; > > - if (max_devices == 1) { > - /* Single zoned block device mount */ > - FDEV(0).bdev = > - blkdev_get_by_dev(sbi->sb->s_bdev->bd_dev, mode, > - sbi->sb->s_type, NULL); > - } else { > + if (max_devices > 1) { > /* Multi-device mount */ > memcpy(FDEV(i).path, RDEV(i).path, MAX_PATH_LEN); > FDEV(i).total_segments = > @@ -4215,10 +4212,9 @@ static int f2fs_scan_devices(struct f2fs_sb_info *sbi) > FDEV(i).end_blk = FDEV(i).start_blk + > (FDEV(i).total_segments << > sbi->log_blocks_per_seg) - 1; > + FDEV(i).bdev = blkdev_get_by_path(FDEV(i).path, > + mode, sbi->sb->s_type, NULL); > } > - FDEV(i).bdev = blkdev_get_by_path(FDEV(i).path, mode, > - sbi->sb->s_type, > - NULL); > } > if (IS_ERR(FDEV(i).bdev)) > return PTR_ERR(FDEV(i).bdev); > -- > 2.39.2 _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel