Received: by 2002:a25:ef43:0:0:0:0:0 with SMTP id w3csp819698ybm; Wed, 27 May 2020 08:46:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxNkGCgwFkAcSyEbUvlZORfQCAEi7c/n/TNptCv8lJ6DY66H9E47qHdDXAVokRoISLRzOzl X-Received: by 2002:a17:906:57d3:: with SMTP id u19mr6900327ejr.401.1590594378592; Wed, 27 May 2020 08:46:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590594378; cv=none; d=google.com; s=arc-20160816; b=jhTPnVc+8ulRYOSlmyVELFDO152tJWd+DF8UNmHJsamdbvvvq/KCKxATFxNgagVb+j HdIeI4vf46fDKU2XnmGarigXZlJkUC9jkFC+jzundQ7TSam3HcV6hAIw8YFsTbyy09l5 vv0qlmWdrkLf0eX1KAkc9L9OxsC9CS1ApB2juaFw/Mzxa4CCQTXf6w2I9t21EpoMrQZt nvZOASzqwN+3h74PUmHOVJAGCEeSVGcoIuvHC95kia/8SaJ+xD/Dt733syCOtS+89Ysh W5EUTFD3e05c0UdT5Jy8nESR7m3Qo3cvb+MGTQyRcNIShNPZEqkQhw+WeSUXGBMPtjZQ cwTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature; bh=jh5TVOqSmpxmOnSU5fr7fIRyAcZw/0QREHa4Ejfg4h4=; b=bivwjzMw+Vo94VxfwwhnbTUG0pqEmzrvVrxiChtS9EBpkpiRrs/bGWrT2NvLfFVIGa mX7HrjvW5G4H+6702cMNVcwY1lfNZxHjxwOwt9+s3yfA3mjVcUahjpcrCPDr6QjpQ1w9 pjjMPodxHXqbIrXKJbSiC7BXTfzy6lWPQ9gNuae4xW8FBf3NZid4MeFF5TmWK5QEA9jq 2cU4dz8le0EAnMNg492GFdM4svCOENhkc6/xSHe5VEV7wrqTstjyevfiF9kYzHH+/Oj6 vcvF3EsmHeUwoOM5rS37fniCJ0XlUuAR+SMvZfZ11OM4+xCoW/p5L/VPqtHH3XfZnsBY nPUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=LH33kOmA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g7si1813098edm.288.2020.05.27.08.45.55; Wed, 27 May 2020 08:46:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=LH33kOmA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728425AbgE0L3z (ORCPT + 99 others); Wed, 27 May 2020 07:29:55 -0400 Received: from mail.kernel.org ([198.145.29.99]:60750 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725766AbgE0L3y (ORCPT ); Wed, 27 May 2020 07:29:54 -0400 Received: from mail-oo1-f50.google.com (mail-oo1-f50.google.com [209.85.161.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0B748208C3; Wed, 27 May 2020 11:29:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1590578994; bh=tv2Km+njjIRyeTVL9eEojM928rYv6nfC4WtJm+JtuiI=; h=In-Reply-To:References:From:Date:Subject:To:Cc:From; b=LH33kOmAF5kk8gmaROPq2T1PO9AWcn0dS6sc9wnkwnvHXR5of1jCcDm2EZrucB1Fw TAriG0VFzKEpMdkkoEnvoWgqj8AoFUiFGS6Wpuowf+LD2BMlaQD4DC0+z7z0yewJ9z 5UbkYLC1vs1PK3QH2Areo6ZogOd6XAmJwGOhRo5w= Received: by mail-oo1-f50.google.com with SMTP id v3so274532oot.1; Wed, 27 May 2020 04:29:54 -0700 (PDT) X-Gm-Message-State: AOAM5333IOkhghmpuI9Qyz22P8XRkjoEEMMrheEIlSLeubvJQXD3FQNG l03qUzVeEX/p8dw/bcsNuclA0NV3gqfLLzyv8Qo= X-Received: by 2002:a4a:7ac2:: with SMTP id a185mr2726927ooc.84.1590578993346; Wed, 27 May 2020 04:29:53 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:ac9:1d8:0:0:0:0:0 with HTTP; Wed, 27 May 2020 04:29:52 -0700 (PDT) In-Reply-To: References: <20200520075641.32441-1-kohada.tetsuhiro@dc.mitsubishielectric.co.jp> <055a01d63306$82b13440$88139cc0$@samsung.com> From: Namjae Jeon Date: Wed, 27 May 2020 20:29:52 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] exfat: optimize dir-cache To: "Kohada.Tetsuhiro@dc.MitsubishiElectric.co.jp" Cc: Sungjong Seo , "Mori.Takahiro@ab.MitsubishiElectric.co.jp" , "Motai.Hirotaka@aj.MitsubishiElectric.co.jp" , Namjae Jeon , "linux-fsdevel@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "kohada.t2@gmail.com" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 2020-05-27 17:00 GMT+09:00, Kohada.Tetsuhiro@dc.MitsubishiElectric.co.jp : > Thank you for your comment. > > >> + for (i = 0; i < es->num_bh; i++) { > >> + if (es->modified) > >> + exfat_update_bh(es->sb, es->bh[i], sync); > > > > Overall, it looks good to me. > > However, if "sync" is set, it looks better to return the result of > exfat_update_bh(). > > Of course, a tiny modification for exfat_update_bh() is also required. > > I thought the same, while creating this patch. > However this patch has changed a lot and I didn't add any new error > checking. > (So, the same behavior will occur even if an error occurs) > > >> +struct exfat_dentry *exfat_get_dentry_cached( > >> + struct exfat_entry_set_cache *es, int num) { > >> + int off = es->start_off + num * DENTRY_SIZE; > >> + struct buffer_head *bh = es->bh[EXFAT_B_TO_BLK(off, es->sb)]; > >> + char *p = bh->b_data + EXFAT_BLK_OFFSET(off, es->sb); > > > > In order to prevent illegal accesses to bh and dentries, it would be > better to check validation for num and bh. > > There is no new error checking for same reason as above. > > I'll try to add error checking to this v2 patch. > Or is it better to add error checking in another patch? The latter:) Thanks! > > BR > --- > Kohada Tetsuhiro