mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/3] ocfs2: fix metadata reservation for xattr value trees
@ 2026-10-10 11:34 Joseph Qi
  2026-10-10 11:34 ` [PATCH 1/3] ocfs2: reserve metadata for a new xattr block and its value tree Joseph Qi
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Joseph Qi @ 2026-10-10 11:34 UTC (permalink / raw)
  To: Andrew Morton, Heming Zhao
  Cc: Mark Fasheh, Joel Becker, ocfs2-devel, linux-kernel

ocfs2_calc_xattr_set_need() reserves too little metadata for a new xattr
value's extent tree on three paths.  The reservation cannot be topped up
once the transaction has started, so ocfs2_add_clusters_in_btree() gives
up with RESTART_META when the value root fills and nothing is left.
ocfs2_xattr_extend_allocation() turns that into -ENOSPC, after
ocfs2_xa_cleanup_value_truncate() has dropped the entry and leaked the
clusters already handed out; before commit 0cdc7dde00ec ("ocfs2: fix
missing metadata reservation for large xattrs") it was a BUG_ON()
instead.  It takes a fragmented cluster allocator to get there, since
the first extent always fits in the root.

Patch 1 fixes the create side of meta_guess: commit 3ed2be719eb9 ("ocfs2:
allow for more than one data extent when creating xattr") replaced the
block reserved for the new xattr block with the two the value tree needs
instead of adding them together.

Patch 2 fixes the arm that moves an xattr back into the inode, which
charges credits for a value tree but no metadata for one.

Patch 3 drops a second copy of the same reservation on the path that
falls through to meta_guess.  That one is cleanup rather than a fix and
is not for stable, and it must not be backported without patch 1: the
duplicate it removes is what currently covers the shortfall patch 1
fixes.

Based on linux-next-20261008.

Joseph Qi (3):
  ocfs2: reserve metadata for a new xattr block and its value tree
  ocfs2: reserve value tree metadata when moving an xattr into the inode
  ocfs2: reserve xattr value tree metadata only once

 fs/ocfs2/xattr.c | 33 ++++++++++++++++++++++++++++++---
 1 file changed, 30 insertions(+), 3 deletions(-)

-- 
2.39.3


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

end of thread, other threads:[~2026-10-10 11:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-10 11:34 [PATCH 0/3] ocfs2: fix metadata reservation for xattr value trees Joseph Qi
2026-10-10 11:34 ` [PATCH 1/3] ocfs2: reserve metadata for a new xattr block and its value tree Joseph Qi
2026-10-10 11:34 ` [PATCH 2/3] ocfs2: reserve value tree metadata when moving an xattr into the inode Joseph Qi
2026-10-10 11:34 ` [PATCH 3/3] ocfs2: reserve xattr value tree metadata only once Joseph Qi

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®