Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp1796639pxb; Wed, 9 Feb 2022 04:50:48 -0800 (PST) X-Google-Smtp-Source: ABdhPJzJL/ZxLt2hO6/STc5Y4QEtCCI0zQ8M7rmozoy73wFZqPCD3mRd5KsrK96m6Is8GrO6u/HG X-Received: by 2002:a17:90a:7e10:: with SMTP id i16mr3239103pjl.188.1644411048211; Wed, 09 Feb 2022 04:50:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644411048; cv=none; d=google.com; s=arc-20160816; b=s0Mi4wWC89j0ZNrjUamQnFV0rfMHIxULimIdtWNa3/CCePSCN5ABP8+w9pVIq3YjwI ZIKo7mtz+KyWa6nujCCA71gfx0YJNkuCMCAJX78evOMbzuGPpKzmX00zeY+GC2k/W/f/ Ys60gNAw4zWx8WyQqoRQEcxHKmxSIQEhlDnImFDFJTr/48rHJy2gMeqNwrMRy5yhBxss uaGfOF6MIRmZzk+m8z2dXkJA+/w9+6PIQRyXJbZSJt3JQhE080R7zEK2vBGMBGnq7V7M IW51CvpbIk1A7Hz5vTEGeSwgY4t3V1Ui85Ti0MGkIqj5NvwfTuctRQD65mjCMv5pVsf0 t/jQ== 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:mail-followup-to:message-id:subject:cc:to:from:date; bh=UudGXe8rrcfkt55nLUglPk+IH4hri/RgjS7fcJsJvzo=; b=BUAcKPnufLnY4kftprfv5+mgtsmJzLJ7sSscpjmCInhE7KrXUTBl5L9lkXITl2pQtr vkcStlIWwzeYIt8GWSNIhe5WbmEyqZ1I0iZqAQJPXp3TNk+ArFYnZG0A1T6W1wZCCO/d UynGKxTD1QigNEQSjjTbEU48NPtnlJQMNhCeQPby32mftESTAMOuQMN1XYmxJtzKe2Bc /yPHEo5pqW8IUITudHFVRS9RJ9yRD2KW7IIk78vDAcp0CRShGAfLsQG1P3R5jko5hrhY vHjcCZ0R5uRxBFf8BgoJfCdd0CIDpV9QtKs1RhP2Gm5RMGWSISCQqFoGJVHJQeSqqV4j qRiQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id 10si16847374pga.258.2022.02.09.04.50.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Feb 2022 04:50:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 2A9FCE0536E3; Wed, 9 Feb 2022 02:30:42 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239740AbiBIHxC (ORCPT + 99 others); Wed, 9 Feb 2022 02:53:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46144 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229908AbiBIHxA (ORCPT ); Wed, 9 Feb 2022 02:53:00 -0500 Received: from out30-133.freemail.mail.aliyun.com (out30-133.freemail.mail.aliyun.com [115.124.30.133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ACD03C0613CB; Tue, 8 Feb 2022 23:53:03 -0800 (PST) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R171e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04407;MF=hsiangkao@linux.alibaba.com;NM=1;PH=DS;RN=16;SR=0;TI=SMTPD_---0V3zwdmU_1644393177; Received: from B-P7TQMD6M-0146.local(mailfrom:hsiangkao@linux.alibaba.com fp:SMTPD_---0V3zwdmU_1644393177) by smtp.aliyun-inc.com(127.0.0.1); Wed, 09 Feb 2022 15:52:59 +0800 Date: Wed, 9 Feb 2022 15:52:55 +0800 From: Gao Xiang To: Jeffle Xu Cc: dhowells@redhat.com, linux-cachefs@redhat.com, xiang@kernel.org, chao@kernel.org, linux-erofs@lists.ozlabs.org, torvalds@linux-foundation.org, gregkh@linuxfoundation.org, willy@infradead.org, linux-fsdevel@vger.kernel.org, joseph.qi@linux.alibaba.com, bo.liu@linux.alibaba.com, tao.peng@linux.alibaba.com, gerry@linux.alibaba.com, eguan@linux.alibaba.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 06/22] erofs: use meta buffers for erofs_read_superblock() Message-ID: Mail-Followup-To: Jeffle Xu , dhowells@redhat.com, linux-cachefs@redhat.com, xiang@kernel.org, chao@kernel.org, linux-erofs@lists.ozlabs.org, torvalds@linux-foundation.org, gregkh@linuxfoundation.org, willy@infradead.org, linux-fsdevel@vger.kernel.org, joseph.qi@linux.alibaba.com, bo.liu@linux.alibaba.com, tao.peng@linux.alibaba.com, gerry@linux.alibaba.com, eguan@linux.alibaba.com, linux-kernel@vger.kernel.org References: <20220209060108.43051-1-jefflexu@linux.alibaba.com> <20220209060108.43051-7-jefflexu@linux.alibaba.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20220209060108.43051-7-jefflexu@linux.alibaba.com> X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY autolearn=no 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-kernel@vger.kernel.org On Wed, Feb 09, 2022 at 02:00:52PM +0800, Jeffle Xu wrote: > The only change is that, meta buffers read cache page without __GFP_FS > flag, which shall not matter. > > Signed-off-by: Jeffle Xu Reviewed-by: Gao Xiang (If this patchset left behind anyway, I will submit this cleanup independently for the next cycle.) Thanks, Gao Xiang > --- > fs/erofs/super.c | 13 +++++-------- > 1 file changed, 5 insertions(+), 8 deletions(-) > > diff --git a/fs/erofs/super.c b/fs/erofs/super.c > index 915eefe0d7e2..12755217631f 100644 > --- a/fs/erofs/super.c > +++ b/fs/erofs/super.c > @@ -281,21 +281,19 @@ static int erofs_init_devices(struct super_block *sb, > static int erofs_read_superblock(struct super_block *sb) > { > struct erofs_sb_info *sbi; > - struct page *page; > + struct erofs_buf buf = __EROFS_BUF_INITIALIZER; > struct erofs_super_block *dsb; > unsigned int blkszbits; > void *data; > int ret; > > - page = read_mapping_page(sb->s_bdev->bd_inode->i_mapping, 0, NULL); > - if (IS_ERR(page)) { > + data = erofs_read_metabuf(&buf, sb, 0, EROFS_KMAP); > + if (IS_ERR(data)) { > erofs_err(sb, "cannot read erofs superblock"); > - return PTR_ERR(page); > + return PTR_ERR(data); > } > > sbi = EROFS_SB(sb); > - > - data = kmap(page); > dsb = (struct erofs_super_block *)(data + EROFS_SUPER_OFFSET); > > ret = -EINVAL; > @@ -365,8 +363,7 @@ static int erofs_read_superblock(struct super_block *sb) > if (erofs_sb_has_ztailpacking(sbi)) > erofs_info(sb, "EXPERIMENTAL compressed inline data feature in use. Use at your own risk!"); > out: > - kunmap(page); > - put_page(page); > + erofs_put_metabuf(&buf); > return ret; > } > > -- > 2.27.0