Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp6372591ybi; Wed, 31 Jul 2019 13:10:11 -0700 (PDT) X-Google-Smtp-Source: APXvYqy702MZYo3W5UDNild52s7v4seeW3Zp/7ntoB8PVknitdd+aUhYeO/yBeXDttdKU2ei3Ndw X-Received: by 2002:a63:c50f:: with SMTP id f15mr15726108pgd.372.1564603811293; Wed, 31 Jul 2019 13:10:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564603811; cv=none; d=google.com; s=arc-20160816; b=B081SOAfoOVQwNO26ZCFXXgm33GuBXA7VGe1WTsOthrtfIhmeZ/ClrpWOxxwU3Ww9B mIMNZynErDZRBqVJoyCytBYfpT/p5X0igZMPuqs9YXWwlU8a2826mZFN/g6cZgADEO/2 G5grLQbRU0B4SC2ML3t3UUjtmG+EwM1mVwEDGZKGbIYiVfcAlyHELZlhY50jdzycxLpt lbe1JKr7yIEnVgXsulEmggo649DgcuqeyO9YCo1YMRjxYdWnhegKx0Dnb2RM++tRiZXW ohnZ3d3rjRMVPbr9M6M0Pb+M3YRobsRExzUiYQAMWI5Bmmy2m4OsF3hIQKTPq8KHOyfR oLSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:message-id:subject:cc:to:from :date:content-transfer-encoding:mime-version; bh=HcpZ/doR7qV15QYolKq/OvIBYb3V2GAkGVdoM+uYmD8=; b=SxIsu3SuePYfq5uQkH+x/g6E/J1iH1X16etW/kniM8/Lp8xiX3Lhmt2y3rQUMgxc1M WOgIhxy1H0jraFrWh7JJGjKFJhB3Nm5vQfeChQsUgBjdp97dy46/aCtOTz7GvZaApHK/ 8HWFjWCkb4gCfQe1Sjv9wRyNLvQ3F/9AMDeZRslOsrNiVWZCtT7qoP0PgawwHAPBaLMa k+KcD1Tsr8HpHnXuYbmvUZlJRToZ62GPq9zvu8me+yGbWVB7NgWhambDe578ber5TTp+ hHPtyeOjiW01vhRxaPQti1Xul7+lO7yCAkVsWDUI04YiUGdHp67c1JenQ1KYnIa8eAjP dO3g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h99si2139328pje.83.2019.07.31.13.09.55; Wed, 31 Jul 2019 13:10:11 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730596AbfGaUCa (ORCPT + 99 others); Wed, 31 Jul 2019 16:02:30 -0400 Received: from latitanza.investici.org ([82.94.249.234]:42891 "EHLO latitanza.investici.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729094AbfGaUC2 (ORCPT ); Wed, 31 Jul 2019 16:02:28 -0400 X-Greylist: delayed 542 seconds by postgrey-1.27 at vger.kernel.org; Wed, 31 Jul 2019 16:02:27 EDT Received: from contumacia-webmail.investici.org (contumacia.vpn0.investici.org [10.0.0.11]) by latitanza.investici.org (Postfix) with ESMTP id 0D95E1204D3; Wed, 31 Jul 2019 19:53:24 +0000 (UTC) Received: from 1.webmail.investici.org (localhost [127.0.0.1]) (Authenticated sender: gallefray@inventati.org) by contumacia-webmail.investici.org (Postfix) with ESMTPA id DD8F6C06D3; Wed, 31 Jul 2019 19:53:19 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Wed, 31 Jul 2019 19:53:19 +0000 From: Finn O'Leary To: mtk.manpages@gmail.com Cc: linux-man@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [patch] setxattr.2: Add ERANGE to 'ERRORS' section Message-ID: X-Sender: finnoleary@inventati.org User-Agent: Roundcube Webmail Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 diff --git a/man2/setxattr.2 b/man2/setxattr.2 index 66272ac..f8edad0 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