mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Youling Tang <youling.tang@linux.dev>
To: Namjae Jeon <linkinjeon@kernel.org>,
	Sungjong Seo <sj1557.seo@samsung.com>
Cc: Yuezhang Mo <yuezhang.mo@sony.com>,
	Chi Zhiling <chizhiling@163.com>,
	exfat@lists.linux.dev, linux-kernel@vger.kernel.org,
	youling.tang@linux.dev, Youling Tang <tangyouling@kylinos.cn>
Subject: [PATCH v2 0/2] exfat: fix iomap mapping vs truncate race
Date: Mon, 16 Nov 2026 17:07:18 +0800	[thread overview]
Message-ID: <20261116090720.3226446-1-youling.tang@linux.dev> (raw)

From: Youling Tang <tangyouling@kylinos.cn>

This series fixes two related problems in the exfat iomap path.

Patch 1 fixes a race between iomap mapping and truncate: i_size was read
twice, and a shrink in between could make the mapping length negative,
which underflowed the cluster count.

Patch 2 fixes the handling of the EXFAT_EOF_CLUSTER sentinel.  The iomap
code used to convert it into a physical address; now exfat_map_cluster()
maps only the valid prefix when a range straddles the end of the chain,
and iomap reports the remaining range as a hole, matching the old
buffer_head code.

Patch 2 relies on the non-negative length guaranteed by patch 1 for the
hole mapping.

Changes since v1:
 - Move the valid-prefix clamp into exfat_map_cluster().

v1: https://lore.kernel.org/exfat/20261113080658.2440516-1-youling.tang@linux.dev/T/#t

Youling Tang (2):
  exfat: fix iomap mapping when writeback races with truncate
  exfat: don't map EXFAT_EOF_CLUSTER as a physical cluster

 fs/exfat/inode.c | 15 ++++++++++++---
 fs/exfat/iomap.c | 21 +++++++++++++++++----
 2 files changed, 29 insertions(+), 7 deletions(-)

-- 
2.43.0


             reply	other threads:[~2026-11-16  9:07 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-16  9:07 Youling Tang [this message]
2026-11-16  9:07 ` [PATCH v2 1/2] exfat: fix iomap mapping when writeback races with truncate Youling Tang
2026-11-16  9:07 ` [PATCH v2 2/2] exfat: don't map EXFAT_EOF_CLUSTER as a physical cluster Youling Tang
2026-11-16  9:39   ` Chi Zhiling

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261116090720.3226446-1-youling.tang@linux.dev \
    --to=youling.tang@linux.dev \
    --cc=chizhiling@163.com \
    --cc=exfat@lists.linux.dev \
    --cc=linkinjeon@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sj1557.seo@samsung.com \
    --cc=tangyouling@kylinos.cn \
    --cc=yuezhang.mo@sony.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®