[PATCH V2] xfs: allow SECURE namespace xattrs to use reserved block pool

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---

V2: Remove local variable, add comment.

diff --git a/fs/xfs/xfs_xattr.c b/fs/xfs/xfs_xattr.c
index ab3d22f662f2..09f004af7672 100644
--- a/fs/xfs/xfs_xattr.c
+++ b/fs/xfs/xfs_xattr.c
@@ -110,7 +110,16 @@ xfs_attr_change(
 	args->whichfork = XFS_ATTR_FORK;
 	xfs_attr_sethash(args);
 
-	return xfs_attr_set(args, op, args->attr_filter & XFS_ATTR_ROOT);
+	/*
+	 * Allow xattrs for ACLs (ROOT namespace) and SELinux contexts
+	 * (SECURE namespace) to use the reserved block pool for these
+	 * security-related operations. xattrs typically reside in the inode,
+	 * so in many cases the reserved pool won't actually get consumed,
+	 * but this will help the worst-case transaction reservations to
+	 * succeed.
+	 */
+	return xfs_attr_set(args, op,
+		    args->attr_filter & (XFS_ATTR_ROOT | XFS_ATTR_SECURE));
 }
 
 






[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux