mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v3 0/4] ntfs: fix spurious EIO and ENOSPC on nearly full volumes
@ 2026-10-04  9:56 Matthias Goergens
  2026-10-04  9:56 ` [PATCH v3 1/4] ntfs: set the attribute list size before reserving space for it Matthias Goergens
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Matthias Goergens @ 2026-10-04  9:56 UTC (permalink / raw)
  To: Namjae Jeon, Hyunchul Lee; +Cc: Baolin Liu, ntfs, linux-kernel

These fix three errors returned while free space is left, and a
contiguous cluster allocation that comes back in two runs.  Patch 1
fixes file creation failing with EIO on a nearly full volume; it now
goes on until the volume is full and then fails with ENOSPC.  Patch 2
fixes the cluster allocator missing free clusters when its start hint
lies at or past the end of the volume, which empties the MFT zone, and
patch 3 removes the fallocate() check that then fails every later call.
Together the two bugs make fallocate() refuse space that is free until
the next mount.  Patch 4 keeps a contiguous request to a single run:
fallocate() zeroes only the first run, so the clusters of a second one
kept the data of a deleted file.  Reproducers, run with KASAN and
lockdep:
https://github.com/matthiasgoergens/linux/tree/reproducer/2026-10-04-ntfs-nearfull-v3

Changes in v3: Namjae Jeon asked whether a contiguous request can still
get a second run once the search has left the hint, for instance when
the run reaches the end of a bitmap page and the next page is skipped as
full.  It can, on that path and on two more: where the search wraps to
pass 2, and where it shrinks the MFT zone after trying every zone.  On
ntfs-next each left 16 of 20 fallocated clusters reading the data of a
deleted file.  New patch 4 does what he suggested: before setting a
cluster's bit, it checks that the cluster follows the run, and returns
the run otherwise.  Patches 1 to 3 are unchanged apart from Hyunchul
Lee's Reviewed-by.  Rebased on ntfs-next.

v2: https://lore.kernel.org/all/cover.1790853718.git.matthias.goergens@gmail.com/
v1: https://lore.kernel.org/all/cover.1790503811.git.matthias.goergens@gmail.com/

Matthias Goergens (4):
  ntfs: set the attribute list size before reserving space for it
  ntfs: restart the zone search when the allocation hint fails
  ntfs: do not refuse fallocate() when the MFT zone is empty
  ntfs: do not give a contiguous cluster allocation a second run

 fs/ntfs/attrlist.c |  5 +++--
 fs/ntfs/file.c     |  3 ---
 fs/ntfs/lcnalloc.c | 35 ++++++++++++++++++++++++++++++++---
 3 files changed, 35 insertions(+), 8 deletions(-)


base-commit: b2a3b6b6c7b09040e3f44ade6e20a7689e4acd28
-- 
2.56.0


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-10-05  2:26 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-04  9:56 [PATCH v3 0/4] ntfs: fix spurious EIO and ENOSPC on nearly full volumes Matthias Goergens
2026-10-04  9:56 ` [PATCH v3 1/4] ntfs: set the attribute list size before reserving space for it Matthias Goergens
2026-10-04  9:56 ` [PATCH v3 2/4] ntfs: restart the zone search when the allocation hint fails Matthias Goergens
2026-10-04  9:56 ` [PATCH v3 3/4] ntfs: do not refuse fallocate() when the MFT zone is empty Matthias Goergens
2026-10-04  9:56 ` [PATCH v3 4/4] ntfs: do not give a contiguous cluster allocation a second run Matthias Goergens
2026-10-05  2:26 ` [PATCH v3 0/4] ntfs: fix spurious EIO and ENOSPC on nearly full volumes Namjae Jeon

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®