mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/2] hfs/hfsplus: set s_maxbytes from the volume capacity
@ 2026-11-06  0:49 Viacheslav Dubeyko
  2026-11-06  0:49 ` [PATCH 1/2] hfsplus: " Viacheslav Dubeyko
  2026-11-06  0:49 ` [PATCH 2/2] hfs: " Viacheslav Dubeyko
  0 siblings, 2 replies; 3+ messages in thread
From: Viacheslav Dubeyko @ 2026-11-06  0:49 UTC (permalink / raw)
  To: glaubitz, frank.li
  Cc: linux-fsdevel, linux-kernel, vdubeyko, Viacheslav Dubeyko

HFS and HFS+ do not support sparse files: every byte of a file
up to end-of-file has to be backed by an allocated block. As a
result, a write, truncate or copy_file_range() far beyond the
current end-of-file makes the driver zero-fill the whole gap,
which runs out of free space and fails with -ENOSPC rather than
reporting -EFBIG.

Since a file can never be larger than the volume, this series sets
s_maxbytes to the volume capacity instead (capped by
MAX_LFS_FILESIZE for HFS+ and by MAX_NON_LFS for HFS). The VFS then
returns -EFBIG for write(), copy_file_range(), truncate and
fallocate beyond the limit, and trims writes that straddle it. The
now redundant local checks are removed.

Viacheslav Dubeyko (2):
  hfsplus: set s_maxbytes from the volume capacity
  hfs: set s_maxbytes from the volume capacity

 fs/hfs/inode.c     |  7 -------
 fs/hfs/super.c     |  8 ++++++++
 fs/hfsplus/inode.c |  7 -------
 fs/hfsplus/super.c | 10 +++++++++-
 4 files changed, 17 insertions(+), 15 deletions(-)

-- 
2.43.0


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

end of thread, other threads:[~2026-11-06  0:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-06  0:49 [PATCH 0/2] hfs/hfsplus: set s_maxbytes from the volume capacity Viacheslav Dubeyko
2026-11-06  0:49 ` [PATCH 1/2] hfsplus: " Viacheslav Dubeyko
2026-11-06  0:49 ` [PATCH 2/2] hfs: " Viacheslav Dubeyko

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®