All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] btrfs: treat -ERANGE as an error case in btrfs_get_acl()
@ 2018-06-22  2:58 Chengguang Xu
  2018-06-22  5:59 ` Qu Wenruo
  2018-06-22 10:48 ` David Sterba
  0 siblings, 2 replies; 6+ messages in thread
From: Chengguang Xu @ 2018-06-22  2:58 UTC (permalink / raw)
  To: clm, jbacik, dsterba; +Cc: linux-btrfs, Chengguang Xu

Currently, when encoutering -ERANGE in btrfs_get_acl(),
just set acl to NULL so that we cannot get proper
acl information but the operation looks successful.

This patch treats -ERANGE as an error case and meanwhile
print real errno before translating errno to -EIO.

Signed-off-by: Chengguang Xu <cgxu519@gmx.com>
---
 fs/btrfs/acl.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/btrfs/acl.c b/fs/btrfs/acl.c
index 15e1dfef56a5..7b3a83dd917c 100644
--- a/fs/btrfs/acl.c
+++ b/fs/btrfs/acl.c
@@ -42,9 +42,10 @@ struct posix_acl *btrfs_get_acl(struct inode *inode, int type)
 	}
 	if (size > 0) {
 		acl = posix_acl_from_xattr(&init_user_ns, value, size);
-	} else if (size == -ERANGE || size == -ENODATA || size == 0) {
+	} else if (size == -ENODATA || size == 0) {
 		acl = NULL;
 	} else {
+		pr_err_ratelimited("BTRFS: get acl failed, err=%d\n", size);
 		acl = ERR_PTR(-EIO);
 	}
 	kfree(value);
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-06-23  3:40 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-22  2:58 [PATCH] btrfs: treat -ERANGE as an error case in btrfs_get_acl() Chengguang Xu
2018-06-22  5:59 ` Qu Wenruo
2018-06-22  7:42   ` cgxu519
2018-06-22  7:58     ` Qu Wenruo
2018-06-22 10:48 ` David Sterba
2018-06-23  3:40   ` cgxu519

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.