Skip to content

exfat: unify FAT chain walking helpers

Chi Zhiling linux-fsdevel lkml 3 versions – Applied

Status from this message: Applied them to #dev.

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest6 patches 3 repliesApplied
  2. v26 patches 8 repliesSuperseded
  3. v16 patches 1 replySuperseded

Changes in v3 from the cover letter

- rework exfat_chain_advance
- add error handling in exfat_find_location
- misc tweaks

Patches in v3 Applied

#Subject and filesSizeRepliesApplied
1/6exfat: fix incorrect directory checksum after rename to shorter namefs/exfat/dir.c+1 -00 replies
2/6exfat: introduce exfat_cluster_walk helperfs/exfat/exfat_fs.h+22 -10 replies
3/6exfat: use exfat_cluster_walk helperfs/exfat/dir.c fs/exfat/inode.c+13 -450 replies
4/6exfat: remove NULL cache pointer case in exfat_ent_getfs/exfat/fatent.c+9 -140 replies
5/6exfat: introduce exfat_chain_advance helperfs/exfat/exfat_fs.h+21 -00 replies
6/6exfat: use exfat_chain_advance helperfs/exfat/dir.c fs/exfat/namei.c+25 -740 replies

Reviews trailers per patch

None of the 6 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

Patch[email protected]Sungjong SeoYuezhang Mo
SeriesR-b R-b
1/6
2/6
3/6
4/6
5/6T-b
6/6

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v3 thread

Cover letter [PATCH v3 0/6] exfat: unify FAT chain walking helpers

From: Chi Zhiling <[email protected]>

This series introduces and uses two new helpers to simplify FAT chain walking logic across the exfat driver:

1. exfat_fat_walk - walks FAT chain by a given step, handling both ALLOC_NO_FAT_CHAIN and ALLOC_FAT_CHAIN modes

2. exfat_chain_advance - walks an exfat_chain structure by a given step, updating both ->dir and ->size fields atomically with proper boundary checking

These helpers replace open-coded cluster walking logic in dir.c, namei.c and inode.c, improving code readability and ensuring consistent error handling for corrupted FAT chains.

Also includes a fix for incorrect directory checksum when renaming a file to a shorter name.

---

Changes in v3:
- rework exfat_chain_advance
- add error handling in exfat_find_location
- misc tweaks

v1:https://lore.kernel.org/linux-fsdevel/[email protected]/ v2:https://lore.kernel.org/linux-fsdevel/[email protected]/

Chi Zhiling (6):
exfat: fix incorrect directory checksum after rename to shorter name
exfat: introduce exfat_cluster_walk helper
exfat: use exfat_cluster_walk helper
exfat: remove NULL cache pointer case in exfat_ent_get
exfat: introduce exfat_chain_advance helper
exfat: use exfat_chain_advance helper

 fs/exfat/dir.c      | 119 +++++++++++---------------------------------
 fs/exfat/exfat_fs.h |  44 +++++++++++++++-
 fs/exfat/fatent.c   |  23 ++++-----
 fs/exfat/inode.c    |  11 +---
 fs/exfat/namei.c    |  28 +++--------
 5 files changed, 91 insertions(+), 134 deletions(-)

base-commit: 4129a3a2751cba8511cee5d13145223662a8e019

Signature · 1 line
2.43.0