It's no good to overwrite -ENOMEM using -EINVAL when failing
from mount option parsing, so just return original error code.
Signed-off-by: Chengguang Xu <cgxu...@gmx.com>
---
fs/btrfs/super.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index 0
It's no good to overwrite -ENOMEM using -EINVAL when failing
from mount option parsing, so just return original error code.
Signed-off-by: Chengguang Xu <cgxu...@gmx.com>
Reviewed-by: David Sterba <dste...@suse.com>
Reviewed-by: Qu Wenruo <w...@suse.com>
---
v1->v2:
- Remo
-by: Chengguang Xu
---
v3:
- Fix some other bad practices.
- Add more information to commit log.
v2:
- Avoid errno overriding instead of print error message in error case.
- Change commit log for better understanding.
fs/btrfs/acl.c | 13 ++---
1 file changed, 6 insertions(+), 7 deletions(-)
diff
Remove -ERANGE error check because there is no chance to get into
this condition and meanwhile avoid overriding errno to -EIO in
btrfs_get_acl().
Signed-off-by: Chengguang Xu
---
v2:
- Avoid errno overriding instead of print error message in error case.
- Change commit log for better
The caller of btrfs_get_acl() checks error condition so there is no
impact from this change. In practice there is no chance to get into
default case of switch statement because VFS has already checked
the type.
Signed-off-by: Chengguang Xu
Reviewed-by: Nikolay Borisov
---
v4:
- Split patch
In btrfs_get_acl() the first call of btr_getxattr() is for getting
the length of attribute, the value buffer is never used in this
case. So it's better to replace empty string with NULL.
Signed-off-by: Chengguang Xu
Reviewed-by: Nikolay Borisov
---
v4:
- Split patch to series.
v3:
- Fix some
-by: Chengguang Xu
Reviewed-by: Nikolay Borisov
---
v4:
- Split patch to series.
v3:
- Fix some toher bad practices.
- Add more information to commit log.
v2:
- Avoid errno overriding instead of print error message in error case.
- Chagne commit log for better understanding.
fs/btrfs/acl.c | 2
It's only coding style fix not functinal change.
When if/else has only one statement then the bracket
is not needed.
Signed-off-by: Chengguang Xu
Reviewed-by: Nikolay Borisov
---
v4:
- Split patch to series.
v3:
- Fix some toher bad practices.
- Add more information to commit log.
v2:
- Avoid
This patch set does code cleanups for btrfs_get_acl().
Chengguang Xu (5):
btrfs: return error instead of crash when detecting unexpected type in
btrfs_get_acl()
btrfs: replace empty string with NULL when getting attribute length in
btrfs_get_acl()
btrfs: remove unnecessary -ERANGE
It's no good to override error code when failing from
btrfs_getxattr() in btrfs_get_acl() because it will hide
real root cause.
Signed-off-by: Chengguang Xu
Reviewed-by: Nikolay Borisov
---
v4:
- Split patch to series.
v3:
- Fix some toher bad practices.
- Add more information to commit log
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
11 matches
Mail list logo