Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp210369pxa; Tue, 11 Aug 2020 23:04:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzS7PBABCp8Uz4vj9JaMClIy1+6DRWi+Tk8/1vOfpC4J9gQ3POFwCHWQL55PAdBRzqn5Sb4 X-Received: by 2002:a50:e611:: with SMTP id y17mr28512263edm.376.1597212253297; Tue, 11 Aug 2020 23:04:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597212253; cv=none; d=google.com; s=arc-20160816; b=M0yStU3oKmn6rc+66JIQstYCc+bNuoSjLLyT80KBbSmRTXNF7TmlTiI3u7EzbbLrR2 PykB8ejv7vEWInJmqdhIov+PTbZsrrE+Ja//1D8UIy0S14h0M4pgBivxVam2V/XE6R96 BMA7MQTtFwGOjlMnUHOR4n9u8nKZknKtQz1mw4dhkjwZ3/EGGZwx72rnoeXpa+TSEyMr /tG8Z0FckRhwdPbjR4TjF3ut4umAz0D1HaZxV3n+bOo2/5FnHU8yfHBWUGBey9ln0q2S wIrNo3otITFROI5Lk76+ma7lWJZypW54HDIURZolbZYGhIRGcnmaW3NV+I3UpqmWBg2H X/Kg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=HPIOK3rNviX7M7TkAWIwKVBAfKjkjAUG64sCRy5ZUtQ=; b=bObrKj5Up2mk3XqYRsjJWN/fM63FCy6jUvrlja5FNCa18iBnBeYxgacbz8s4A2/cAV eD9O/gM27ZDxFqy6tdyldui7pjOht9CaMQMmexG7YMiuKlry7ZwBp5pxxRVm7akaglvF 8Jvcrjdf55uS5tOUCEPCuC6dtvxnrSylaM8rFYvYcS1psvQCE6sh4ng2qgEPKrjHeyfu 69jeEQcHqM+Vxx2YkYwLu1sRgM7jdgiM719hnefeSd10FBRGQ/maTTp0A7eY5nz+7PC1 n7WZTZ2uzJgBCahLmQSrBcIORrfqkGtRpUEKVbPbm+0BTwpOYpXhAU+WlFRm8ctdhB+x qf1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=oerSCwoH; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u23si304677ejy.469.2020.08.11.23.03.50; Tue, 11 Aug 2020 23:04:13 -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=@gmail.com header.s=20161025 header.b=oerSCwoH; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726642AbgHLGCW (ORCPT + 99 others); Wed, 12 Aug 2020 02:02:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53206 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726483AbgHLGCV (ORCPT ); Wed, 12 Aug 2020 02:02:21 -0400 Received: from mail-pj1-x1042.google.com (mail-pj1-x1042.google.com [IPv6:2607:f8b0:4864:20::1042]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 44A1DC06174A; Tue, 11 Aug 2020 23:02:21 -0700 (PDT) Received: by mail-pj1-x1042.google.com with SMTP id l60so582826pjb.3; Tue, 11 Aug 2020 23:02:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=HPIOK3rNviX7M7TkAWIwKVBAfKjkjAUG64sCRy5ZUtQ=; b=oerSCwoH0WT1Ys/TiLkcsyScgiuNNILFBmNRtCQ/yoz7XwRPub46N6KYvGI0TgtCeb 4tApLHOil3cxXTgPkqY2/H2ON6bWDDDSATT0Zb6gHTu3PG9NdYsymAlq6Pf/eTPwsyS9 IM2cVO6E2lYEDfAdeBU0O+UnxLv5szBnMtN6UpVqPh2iQNbrLRN5ds1+N099oSFHFA3I OImVlEakW/SjBvy/ajBGIJGSa4NxWunELgdagULj67G0Z8jHdud11QRbPRLNiFZa4fgJ hMuEDN4A0sFlQKJXGo/lfwG9x62OyEpfXpN2PBvHyes5x0g60WD4eXdBXF4JWWoY2bKh 9FgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=HPIOK3rNviX7M7TkAWIwKVBAfKjkjAUG64sCRy5ZUtQ=; b=nKMfyufzhzIG9Vqtbq7RMITjRYx9wi6C+CUVDQgFRZylkPVU++59dhBIKRbfVrcNHw srGVgE+coxmP7W48B/hzFEcKkANyP5SJ2FN/SB8a9zkxNQn8X2nH0A9wIZWLpw4suhsI xD4/zwbKOCvlZHdiBJYPZnyfkC5tZlAMk/q5qohrj8FJKi8AZ828an8Kn6Yjb3wifNON hd6azkMK5Cx2F5Kza5T12xNDZ+bhCVRgTqOsi84qzhqbdQ2QN6O934oXK0kT47XmdYCj G7nxQ4J4wudY2lwsmL+Rrim+BWN7GhpPtE/QdTGP77kjaIsP3w/bz7tvv2R7thj4ydTy JezA== X-Gm-Message-State: AOAM532jbqwgcWIyJfayowB3e79ZsWJ/xOsl9QjRAIOgLnlBzmjnVKRV RjHVNAsqCCuczhtysIEWUXW8Ee69 X-Received: by 2002:a17:90b:c90:: with SMTP id o16mr4293425pjz.79.1597212140341; Tue, 11 Aug 2020 23:02:20 -0700 (PDT) Received: from ?IPv6:2404:7a87:83e0:f800:5c24:508b:d8c0:f3b? ([2404:7a87:83e0:f800:5c24:508b:d8c0:f3b]) by smtp.gmail.com with ESMTPSA id s67sm1048954pfs.117.2020.08.11.23.02.17 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 11 Aug 2020 23:02:19 -0700 (PDT) Subject: Re: [PATCH 2/2] exfat: unify name extraction To: Sungjong Seo Cc: kohada.tetsuhiro@dc.mitsubishielectric.co.jp, mori.takahiro@ab.mitsubishielectric.co.jp, motai.hirotaka@aj.mitsubishielectric.co.jp, 'Namjae Jeon' , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org References: <20200806055653.9329-1-kohada.t2@gmail.com> <20200806055653.9329-2-kohada.t2@gmail.com> <000201d66da8$07a2c750$16e855f0$@samsung.com> From: Tetsuhiro Kohada Message-ID: Date: Wed, 12 Aug 2020 15:02:17 +0900 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: <000201d66da8$07a2c750$16e855f0$@samsung.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Thanks for your reply. On 2020/08/09 2:19, Sungjong Seo wrote: > [snip] >> @@ -963,80 +942,38 @@ int exfat_find_dir_entry(struct super_block *sb, >> struct exfat_inode_info *ei, >> num_empty = 0; >> candi_empty.eidx = EXFAT_HINT_NONE; >> > [snip] >> >> - if (entry_type & >> - (TYPE_CRITICAL_SEC | > TYPE_BENIGN_SEC)) { >> - if (step == DIRENT_STEP_SECD) { >> - if (++order == num_ext) >> - goto found; >> - continue; >> - } >> + exfat_get_uniname_from_name_entries(es, &uni_name); > > It is needed to check a return value. I'll fix it in v2. >> + exfat_free_dentry_set(es, false); >> + >> + if (!exfat_uniname_ncmp(sb, >> + p_uniname->name, >> + uni_name.name, >> + name_len)) { >> + /* set the last used position as hint */ >> + hint_stat->clu = clu.dir; >> + hint_stat->eidx = dentry; > > eidx and clu of hint_stat should have one for the next entry we'll start > looking for. > Did you intentionally change the concept? Yes, this is intentional. Essentially, the "Hint" concept is to reduce the next seek cost with minimal cost. There is a difference in the position of the hint, but the concept is the same. As you can see, the patched code strategy doesn't move from current position. Basically, the original code strategy is advancing only one dentry.(It's the "minimum cost") However, when it reaches the cluster boundary, it gets the next cluster and error handling. Getting the next cluster The error handling already exists at the end of the while loop, so the code is duplicated. These costs should be paid next time and are no longer the "minimum cost". Should I add this to the commit-message? BR --- Tetsuhiro Kohada