From 7f4f24eaf1c90514229c30ccaad83fa51571cb40 Mon Sep 17 00:00:00 2001 From: Michael Kerrisk Date: Wed, 22 Apr 2015 10:38:31 +0200 Subject: [PATCH] attr.7: Document EA limits for Btrfs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From experimentation, I found a 16kB limit on name + value + overhead bytes. Digger deeper, I see that https://btrfs.wiki.kernel.org/index.php/Project_ideas#Unlimited_extended_attributes says: Unlimited extended attributes Not claimed — no patches yet — Not in kernel yet Currently size of value of an extended attribute must fit into inline space (~3900 on 4k leaf size), while other filesystems do not limit the size. Add a new b-tree item to hold the xattr value in extents. And reading mkfs.btrfs(8) reveals that the default node (AKA leaf) size is 16kB. Signed-off-by: Michael Kerrisk --- man7/attr.7 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/man7/attr.7 b/man7/attr.7 index 491482de3..75379e697 100644 --- a/man7/attr.7 +++ b/man7/attr.7 @@ -155,6 +155,12 @@ attribute information on disk are scalable. In the JFS, XFS, and Reiserfs filesystem implementations, the limit on bytes used in an EA value is the ceiling imposed by the VFS. + +In the Btrfs filesystem implementation, +the total bytes used for the name, value, and implementation overhead bytes +is limited to the filesystem +.I nodesize +value (16kB by default). .SH CONFORMING TO Extended attributes are not specified in POSIX.1, but some other systems (e.g., the BSDs and Solaris) provide a similar feature.