From nobody Mon Feb 9 16:17:19 2026 Received: from m16.mail.163.com (m16.mail.163.com [117.135.210.2]) (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 6F39E38A28D; Wed, 14 Jan 2026 12:18:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=117.135.210.2 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768393093; cv=none; b=Pkh5RCFYOjNk81EZr515hHYZcQFFExy8v2bzGnYnAnEhyPzEjE6morcP1SHrnAxS33TefeB85KLaKjrADsG9SVzdFNLUyPrZjoCw746Tl33w+pk0orJfFnTt0aH3jzdogUcvgvm3Q6hoauJaLb9PPcazYCvaSmCdN1AzRJtfahw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768393093; c=relaxed/simple; bh=5CPnencKtvcQWuRvkrQVcepJuJk42Lwa9FBjfMpnkWE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=POC18WXBa+cP4QKbPKxrm8jjG1mZpJbQGG5RBHqNcB9u6rov8pXPihlZ6FdR+pHGEwvg0Bzf8yalhjbZftzrYjwfAZ60ZeNvO4xypCKwhgaIsUfLODeNzeUx6b469UBO42UZer0OXf3cgVupMs1LutHvS1vUF0ktrjxsZhTYk1o= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=163.com; spf=pass smtp.mailfrom=163.com; dkim=pass (1024-bit key) header.d=163.com header.i=@163.com header.b=DHPupvco; arc=none smtp.client-ip=117.135.210.2 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=163.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=163.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=163.com header.i=@163.com header.b="DHPupvco" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:To:Subject:Date:Message-ID:MIME-Version; bh=UI fjRH6grVewKiAQNlqkmnbVW08mAABKdCzAln6lWgM=; b=DHPupvcoNJ0e0qUyqk F6H5+7aqDeXodfz2MvWavn2Tz5n80bu+4/wpch/SDQ6FfPxfcaDQrvSu/RzsxnEc +yISpJBox7gOO577T+N9hVOEHimuM2UquOIhPq8wolU7jinhK1ODzxUsginpehOw UuMvCqRwIlCQOJe1Lr6nw8yEc= Received: from czl-ubuntu-pc.. (unknown []) by gzga-smtp-mtada-g0-3 (Coremail) with SMTP id _____wDnj1NuiWdpGyITGQ--.2745S2; Wed, 14 Jan 2026 20:17:51 +0800 (CST) From: Chi Zhiling To: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Namjae Jeon , Sungjong Seo , Yuezhang Mo , Chi Zhiling , Yuezhang Mo Subject: [PATCH v3 11/13] exfat: tweak cluster cache to support zero offset Date: Wed, 14 Jan 2026 20:17:47 +0800 Message-ID: <20260114121747.616098-1-chizhiling@163.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260114121250.615064-1-chizhiling@163.com> References: <20260114121250.615064-1-chizhiling@163.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-CM-TRANSID: _____wDnj1NuiWdpGyITGQ--.2745S2 X-Coremail-Antispam: 1Uf129KBjvJXoW7tFWUWw47KrW5ury8Wr1rJFb_yoW8Xr4DpF W7ta45Grs3ZasrCa18tFn2vayrWa97Ka17Ja1UGw1Ykr1qkr40qwnFyrnIv3WDKw48CrsF qFyru3WUur9xGF7anT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07joE_NUUUUU= X-CM-SenderInfo: hfkl6xxlol0wi6rwjhhfrp/xtbC2w+xT2lniW-P1QAA3Y Content-Type: text/plain; charset="utf-8" From: Chi Zhiling The current cache mechanism does not support reading clusters starting from a file offset of zero. This patch enables that feature in preparation for subsequent reads of contiguous clusters from offset zero. 1. support finding clusters with zero offset. 2. allow clusters with zero offset to be cached. Signed-off-by: Chi Zhiling Reviewed-by: Yuezhang Mo --- fs/exfat/cache.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/exfat/cache.c b/fs/exfat/cache.c index 025b39b7a9ac..73147e153c2c 100644 --- a/fs/exfat/cache.c +++ b/fs/exfat/cache.c @@ -92,7 +92,7 @@ static unsigned int exfat_cache_lookup(struct inode *inod= e, spin_lock(&ei->cache_lru_lock); list_for_each_entry(p, &ei->cache_lru, cache_list) { /* Find the cache of "fclus" or nearest cache. */ - if (p->fcluster <=3D fclus && hit->fcluster < p->fcluster) { + if (p->fcluster <=3D fclus && hit->fcluster <=3D p->fcluster) { hit =3D p; if (hit->fcluster + hit->nr_contig < fclus) { offset =3D hit->nr_contig; @@ -259,7 +259,7 @@ int exfat_get_cluster(struct inode *inode, unsigned int= cluster, if (cluster =3D=3D 0 || *dclus =3D=3D EXFAT_EOF_CLUSTER) return 0; =20 - cache_init(&cid, EXFAT_EOF_CLUSTER, EXFAT_EOF_CLUSTER); + cache_init(&cid, fclus, *dclus); exfat_cache_lookup(inode, cluster, &cid, &fclus, dclus); =20 if (fclus =3D=3D cluster) --=20 2.43.0