From nobody Mon Feb 9 17:24:01 2026 Received: from m16.mail.163.com (m16.mail.163.com [117.135.210.3]) (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 D173D393DF0; Wed, 14 Jan 2026 12:13:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=117.135.210.3 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768392823; cv=none; b=oZ+jtTt89l5N/jPTbF+A4GFpjVP+5QRtlaRZ9XKxpHyUsaGxaPUfbftGuRxjp6Wv2RsmrGIhejrEwGsDztYSLBXalGTDn3664m4n+6+FLJTLGbCwuLRNQtM4342IdRunhSb+Njs3yBkCgMcKQiIdSruoDppmS1VslCdDjyqwq2w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768392823; c=relaxed/simple; bh=NW/VGH2Sry/Q+Tqpiz0QPIfYXbyj+zH9xmXmp1swjOA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=GZMxFu4IowpGnClS0k6PpF2sl6efszBEFXV9tWKpIIjWhYU5t5ksnU2vXGflHxwNVxth48Supaok1gkLFdBgHrT4bs5YjEZV1YchIF+9wBx9kPssM+HLcRIbSWsgBzHrV3WSmImOfFXlZdIk+dpaDr9w18ifDpZwWDftKwZuDMk= 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=bVgX1Msk; arc=none smtp.client-ip=117.135.210.3 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="bVgX1Msk" 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=IL d38vwGbbZHuYFWPWdYhYKP11kWC8j3xNXdzwzfSj8=; b=bVgX1MskjKpHpsJLh9 sWTOaj1j1M/BKTXruAPOxD/9qrqp0uXw84Rc2zr5uFySh9cYgbbOnuSJbvZ/n1Qi C4fmrdbIHViUIqFSLblpg3Rb+ZpemzVhC9OoE0l7ckkgiIiA+cqLQR76FR3jKdQj Y0HqHfGoFlN0HibmYq8YTxqtY= Received: from czl-ubuntu-pc.. (unknown []) by gzga-smtp-mtada-g1-3 (Coremail) with SMTP id _____wAXybtbiGdpFdouGQ--.5056S6; Wed, 14 Jan 2026 20:13:18 +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 04/13] exfat: improve exfat_find_last_cluster Date: Wed, 14 Jan 2026 20:12:40 +0800 Message-ID: <20260114121250.615064-5-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: _____wAXybtbiGdpFdouGQ--.5056S6 X-Coremail-Antispam: 1Uf129KBjvJXoW7Jw4UAryfCr15ur4rZFy8AFb_yoW8Jr1kpF WUCa15KrWrX3Wku3WUJFs3Z3Wfu3WxKF95CFW5Aw1Yy3s0qrnYyFy3tryayF4kJa1UKF1a gr1YgF1j9wsxGFJanT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07UR6wtUUUUU= X-CM-SenderInfo: hfkl6xxlol0wi6rwjhhfrp/xtbC9x5tC2lniF56XQAA3w Content-Type: text/plain; charset="utf-8" From: Chi Zhiling Since exfat_ent_get support cache buffer head, let's apply it to exfat_find_last_cluster. Signed-off-by: Chi Zhiling Reviewed-by: Yuezhang Mo --- fs/exfat/fatent.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fs/exfat/fatent.c b/fs/exfat/fatent.c index f060eab2f2f2..71ee16479c43 100644 --- a/fs/exfat/fatent.c +++ b/fs/exfat/fatent.c @@ -296,6 +296,7 @@ int exfat_free_cluster(struct inode *inode, struct exfa= t_chain *p_chain) int exfat_find_last_cluster(struct super_block *sb, struct exfat_chain *p_= chain, unsigned int *ret_clu) { + struct buffer_head *bh =3D NULL; unsigned int clu, next; unsigned int count =3D 0; =20 @@ -308,10 +309,11 @@ int exfat_find_last_cluster(struct super_block *sb, s= truct exfat_chain *p_chain, do { count++; clu =3D next; - if (exfat_ent_get(sb, clu, &next, NULL)) + if (exfat_ent_get(sb, clu, &next, &bh)) return -EIO; } while (next !=3D EXFAT_EOF_CLUSTER && count <=3D p_chain->size); =20 + brelse(bh); if (p_chain->size !=3D count) { exfat_fs_error(sb, "bogus directory size (clus : ondisk(%d) !=3D counted(%d))", --=20 2.43.0