aboutsummaryrefslogtreecommitdiffstats
path: root/man2
diff options
context:
space:
mode:
authorFinn O'Leary <finnoleary@inventati.org>2019-07-31 19:53:19 +0000
committerMichael Kerrisk <mtk.manpages@gmail.com>2019-08-01 19:33:38 +0200
commitacea9500997e42f7ff67a31b3462d8f1a0dacef0 (patch)
tree50970ec059d4913142563be1d35827779d695083 /man2
parentfd6307c47f32b91f691bedd7ff451630c3a8f5c5 (diff)
downloadman-pages-acea9500997e42f7ff67a31b3462d8f1a0dacef0.tar.gz
setxattr.2: Add ERANGE to 'ERRORS' section
Hi, Both the Ext2 filesystem handler and the Ext4 filesystem handler will return the ERANGE error code. Ext2 will return it if the name or value is too long to be able to be stored, Ext4 will return it if the name is too long. For reference, the relevant files/lines (with excerpts) are: fs/ext2/xattr.c: lines 394 to 396 in ext2_xattr_set > 394 name_len = strlen(name); > 395 if (name_len > 255 || value_len > sb->s_blocksize) > 396 return -ERANGE; fs/ext4/xattr.c: lines 2317 to 2318 in ext4_xattr_set_handle > 2317 if (strlen(name) > 255) > 2318 return -ERANGE; Other filesystems also return this code: xfs/libxfs/xfs_attr.h: lines 53 to 55 > * The maximum size (into the kernel or returned from the kernel) of an > * attribute value or the buffer used for an attr_list() call. Larger > * sizes will result in an ERANGE return code. It's possible that more filesystem handlers do this, a cursory grep shows that most of the filesystem xattr handler files mention ERANGE in some form. A suggested patch is below (I'm not 100% sure on the wording through). Thanks -- - Finn Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
Diffstat (limited to 'man2')
-rw-r--r--man2/setxattr.27
1 files changed, 7 insertions, 0 deletions
diff --git a/man2/setxattr.2 b/man2/setxattr.2
index 66272acd81..92a7269979 100644
--- a/man2/setxattr.2
+++ b/man2/setxattr.2
@@ -138,6 +138,13 @@ The namespace prefix of
.I name
is not valid.
.TP
+.B ERANGE
+The given
+.I name
+or
+.I value
+is too long for the filesystem to store.
+.TP
.B ENOTSUP
Extended attributes are not supported by the filesystem, or are disabled,
.TP