public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xfs: allow SECURE namespace xattrs to use reserved pool
@ 2024-07-19 22:48 Eric Sandeen
  2024-07-22 14:41 ` Christoph Hellwig
  2024-07-22 19:25 ` [PATCH V2] xfs: allow SECURE namespace xattrs to use reserved block pool Eric Sandeen
  0 siblings, 2 replies; 12+ messages in thread
From: Eric Sandeen @ 2024-07-19 22:48 UTC (permalink / raw)
  To: linux-xfs@vger.kernel.org

We got a report from the podman folks that selinux relabels that happen
as part of their process were returning ENOSPC when the filesystem is
completely full. This is because xattr changes reserve about 15 blocks
for the worst case, but the common case is for selinux contexts to be
the sole, in-inode xattr and consume no blocks.

We already allow reserved space consumption for XFS_ATTR_ROOT for things
such as ACLs, and selinux / SECURE attributes are not so very different,
so allow them to use the reserved space as well.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---

diff --git a/fs/xfs/xfs_xattr.c b/fs/xfs/xfs_xattr.c
index ab3d22f662f2..e59193609003 100644
--- a/fs/xfs/xfs_xattr.c
+++ b/fs/xfs/xfs_xattr.c
@@ -82,6 +82,7 @@ xfs_attr_change(
 {
 	struct xfs_mount	*mp = args->dp->i_mount;
 	int			error;
+	bool			rsvd;
 
 	if (xfs_is_shutdown(mp))
 		return -EIO;
@@ -110,7 +111,8 @@ xfs_attr_change(
 	args->whichfork = XFS_ATTR_FORK;
 	xfs_attr_sethash(args);
 
-	return xfs_attr_set(args, op, args->attr_filter & XFS_ATTR_ROOT);
+	rsvd = args->attr_filter & (XFS_ATTR_ROOT | XFS_ATTR_SECURE);
+	return xfs_attr_set(args, op, rsvd);
 }
 
 


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

end of thread, other threads:[~2024-07-23 17:26 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-19 22:48 [PATCH] xfs: allow SECURE namespace xattrs to use reserved pool Eric Sandeen
2024-07-22 14:41 ` Christoph Hellwig
2024-07-22 15:05   ` Eric Sandeen
2024-07-22 15:11     ` Christoph Hellwig
2024-07-22 16:43     ` [External] : " mark.tinguely
2024-07-22 22:45     ` Dave Chinner
2024-07-22 19:25 ` [PATCH V2] xfs: allow SECURE namespace xattrs to use reserved block pool Eric Sandeen
2024-07-22 23:05   ` Dave Chinner
2024-07-23 14:59   ` [PATCH V3] " Eric Sandeen
2024-07-23 16:52     ` Darrick J. Wong
2024-07-23 16:56     ` Christoph Hellwig
2024-07-23 17:26     ` [PATCH V4] " Eric Sandeen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox