xfs: return ENOSPC when trying to set more ACLs than XFS_ACL_MAX_ENTRIES
PATCH 1/1 xfs: return ENOSPC when trying to set more ACLs than XFS_ACL_MAX_ENTRIES
From: Jie Liu <[email protected]>
We currently return EINVAL when trying to set more ACL entries than XFS_ACL_MAX_ENTRIES(), but it would be a bit more meaningful to return ENOSPC in this situation, because the later is used to indicate there is no more space to store new ACLs IMHO.
--- fs/xfs/xfs_acl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/xfs/xfs_acl.c +1 -1
@@ -397,7 +397,7 @@ xfs_xattr_acl_set(struct dentry *dentry, const char *name,if (error) goto out_release; - error = -EINVAL ; + error = -ENOSPC ;if (acl->a_count >XFS_ACL_MAX_ENTRIES (XFS_M (inode->i_sb))) goto out_release;
Signature · 6 lines
1.8.3.2 _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
Quoted 6 lines · Jeff Liu
From: Jie Liu <[email protected]>
We currently return EINVAL when trying to set more ACL entries than
XFS_ACL_MAX_ENTRIES(), but it would be a bit more meaningful to return ENOSPC in this situation, because the later is used to indicate there is no more space to store new ACLs IMHO.
I'm not quite convinced that it's better; the user will get an error string of "no space left on device" which is misleading too, and I'd argue that it's no better than "invalid argument."
To me, I think it's not worth changing, but others may disagree.
(I guess looking at ext4, it uses ENOSPC for some similar constraints, so maybe three is precedent for this)
The setxattr(2) man page says:
Quoted 2 lines
If there is insufficient space remaining to store the extended attribute, errno is set to either ENOSPC
but it doesn't say space in _what_ ...
-Eric
Quoted 11 lines
Signed-off-by Jie Liu <[email protected]>--- fs/xfs/xfs_acl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)fs/xfs/xfs_acl.c +0
-0
fs/xfs/xfs_acl.c xfs_xattr_acl_set(struct dentry *dentry, const char *name, · line 403
Quoted 8 lines
fs/xfs/xfs_acl.c +1
-1@@ -397,7 +397,7 @@ xfs_xattr_acl_set(struct dentry *dentry, const char *name,if (error) goto out_release; - error = -EINVAL ; + error = -ENOSPC ;if (acl->a_count >XFS_ACL_MAX_ENTRIES (XFS_M (inode->i_sb))) goto out_release;
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Quoted 10 lines · Eric Sandeen
Quoted 6 lines · Jeff Liu
From: Jie Liu <[email protected]>
We currently return EINVAL when trying to set more ACL entries than
XFS_ACL_MAX_ENTRIES(), but it would be a bit more meaningful to return ENOSPC in this situation, because the later is used to indicate there is no more space to store new ACLs IMHO.I'm not quite convinced that it's better; the user will get an error string of "no space left on device" which is misleading too,
I admit that both looks misleading...
Quoted 6 lines
and I'd argue that it's no better than "invalid argument."
To me, I think it's not worth changing, but others may disagree.
(I guess looking at ext4, it uses ENOSPC for some similar constraints, so maybe three is precedent for this)
Btrfs also uses ENOSPC, but JFS would return something like "Argument list too long" in this case.
Thanks,
-Jeff
Quoted 23 lines
The setxattr(2) man page says:
Quoted 2 lines
If there is insufficient space remaining to store the extended attribute, errno is set to either ENOSPC
but it doesn't say space in _what_ ...
-Eric
Quoted 13 lines
Signed-off-by Jie Liu <[email protected]>--- fs/xfs/xfs_acl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)fs/xfs/xfs_acl.c +0
-0@@ -397,7 +397,7 @@ xfs_xattr_acl_set(struct dentry *dentry, const char *name,if (error) goto out_release;
Quoted 12 lines
fs/xfs/xfs_acl.c xfs_xattr_acl_set(struct dentry *dentry, const char *name, · line 403
Quoted 6 lines
fs/xfs/xfs_acl.c +1
-1- error = -EINVAL ; + error = -ENOSPC ;if (acl->a_count >XFS_ACL_MAX_ENTRIES (XFS_M (inode->i_sb))) goto out_release;_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Hey Jeff,
Quoted 13 lines · Jeff Liu
Quoted 10 lines · Eric Sandeen
Quoted 6 lines · Jeff Liu
From: Jie Liu <[email protected]>
We currently return EINVAL when trying to set more ACL entries than
XFS_ACL_MAX_ENTRIES(), but it would be a bit more meaningful to return ENOSPC in this situation, because the later is used to indicate there is no more space to store new ACLs IMHO.I'm not quite convinced that it's better; the user will get an error string of "no space left on device" which is misleading too,
I admit that both looks misleading...
Quoted 8 lines
Quoted 6 lines
and I'd argue that it's no better than "invalid argument."
To me, I think it's not worth changing, but others may disagree.
(I guess looking at ext4, it uses ENOSPC for some similar constraints, so maybe three is precedent for this)
Btrfs also uses ENOSPC, but JFS would return something like "Argument list too long" in this case.
I tend to agree with Eric on this one, but if Dave or Christoph want to weigh in that's cool.
Thanks,
Ben
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Hi Ben,
Quoted 20 lines · Ben Myers
Hey Jeff,
Quoted 17 lines · Jeff Liu
Quoted 10 lines · Eric Sandeen
Quoted 6 lines · Jeff Liu
From: Jie Liu <[email protected]>
We currently return EINVAL when trying to set more ACL entries than
XFS_ACL_MAX_ENTRIES(), but it would be a bit more meaningful to return ENOSPC in this situation, because the later is used to indicate there is no more space to store new ACLs IMHO.I'm not quite convinced that it's better; the user will get an error string of "no space left on device" which is misleading too,
I admit that both looks misleading...
Quoted 4 lines
and I'd argue that it's no better than "invalid argument."
To me, I think it's not worth changing, but others may disagree.
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines
(I guess looking at ext4, it uses ENOSPC for some similar constraints, so maybe three is precedent for this)
Btrfs also uses ENOSPC, but JFS would return something like "Argument list too long" in this case.
I tend to agree with Eric on this one, but if Dave or Christoph want to weigh in that's cool.
I agree to Eric as well since either errno cannot indicate this situation much cleaner. I also can not find an existing errno could be used for this situation, maybe someday there would have a particular errno to be used in this case if users complain about it.
Thanks,
-Jeff
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Quoted 4 lines · Ben Myers
Quoted 4 lines
Quoted 2 lines
(I guess looking at ext4, it uses ENOSPC for some similar constraints, so maybe three is precedent for this)
Btrfs also uses ENOSPC, but JFS would return something like "Argument list too long" in this case.
I think ENOSPC is a really bad idea in this case, but I also think we should make sure Linux filesystems behave unfiformly.
Jeff, can you write a summary of the errors returned by all common filesystems and post it to -fsdevel for comment? We should have a common error for this, and I'd be a happier man if it weren't ENOSPC, but that's secondary.
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Quoted 6 lines · Christoph Hellwig
Quoted 4 lines · Ben Myers
Quoted 4 lines
Quoted 2 lines
(I guess looking at ext4, it uses ENOSPC for some similar constraints, so maybe three is precedent for this)
Btrfs also uses ENOSPC, but JFS would return something like "Argument list too long" in this case.
Quoted 7 lines
I think ENOSPC is a really bad idea in this case, but I also think we should make sure Linux filesystems behave unfiformly.
Jeff, can you write a summary of the errors returned by all common filesystems and post it to -fsdevel for comment? We should have a common error for this, and I'd be a happier man if it weren't ENOSPC, but that's secondary.
Yep, let me gather up those info...
Thanks,
-Jeff
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs