From: Carlos Maiolino Subject: Re: Common error in case of running out of the number of ACL entries Date: Fri, 13 Dec 2013 14:16:54 -0200 Message-ID: <20131213161653.GA9046@orion.maiolino.org> References: <52AB1D21.3000702@oracle.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii To: linux-fsdevel@vger.kernel.org Return-path: Received: from mx1.redhat.com ([209.132.183.28]:10363 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751872Ab3LMQQ6 (ORCPT ); Fri, 13 Dec 2013 11:16:58 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id rBDGGwD8010424 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 13 Dec 2013 11:16:58 -0500 Received: from orion.maiolino.org (ovpn-113-120.phx2.redhat.com [10.3.113.120]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id rBDGGsot007330 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO) for ; Fri, 13 Dec 2013 11:16:57 -0500 Content-Disposition: inline In-Reply-To: <52AB1D21.3000702@oracle.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Hi, > Hi Folks, > > While looking into the behaviour of XFS in case of running out of the > maximum number of supported acl entries, I observed that we would > return various different errors in this situation. As per Christoph's > suggestion, I gathered up them from some common file systems with a > simple tests which were shown as following: > > Btrfs: No space left on device (ENOSPC) > Ext3: No space left on device (ENOSPC) > Ext4: No space left oo long (E2BIG) > F2fs: Numerical result out of range (ERANGE) > OCFS2: Argument list too long (E2BIG) > XFS: Invalid argument (EINVAL) > > It seems that return either above error would mislead the end user, though > Eric's Sandeen once pointed out that ENOSPC should be used in this case in > terms of the setxattr(2) man page. > > If there is insufficient space remaining to store the extended attribute, > errno is set to either ENOSPC, or EDQUOT if quota enforcement was the cause. > > However, the "insufficient space" is obscure, it might be the file system > space or no more space in metadata blocks, etc... > > Hence, should we consolidate this scenario to figure out a more clearer > common error? > > Consolidate the erros here would make things much more easier for users/applications which has a heavy usage of xattrs, for example, glusterfs. But, I still think that -ENOSPC or -EDQUOT are the best and easier approaches here. Whether it's FS space or metadata blocks, both of them are lack of space, which properly describes why a tentative to add a new xattr failed. At least for me, this looks much easier than add a new error flag and make all applications using xattrs to change their code to fit new behavior (or maybe they'll need to change it anyway to fit -ENOSPC :). -- Carlos