提交 7e35eab9 编写于 作者: C Chengguang Xu 提交者: David Sterba

btrfs: replace empty string with NULL when getting attribute length in btrfs_get_acl

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: NChengguang Xu <cgxu519@gmx.com>
Reviewed-by: NNikolay Borisov <nborisov@suse.com>
Reviewed-by: NDavid Sterba <dsterba@suse.com>
Signed-off-by: NDavid Sterba <dsterba@suse.com>
上级 ab3629ed
...@@ -33,7 +33,7 @@ struct posix_acl *btrfs_get_acl(struct inode *inode, int type) ...@@ -33,7 +33,7 @@ struct posix_acl *btrfs_get_acl(struct inode *inode, int type)
return ERR_PTR(-EINVAL); return ERR_PTR(-EINVAL);
} }
size = btrfs_getxattr(inode, name, "", 0); size = btrfs_getxattr(inode, name, NULL, 0);
if (size > 0) { if (size > 0) {
value = kzalloc(size, GFP_KERNEL); value = kzalloc(size, GFP_KERNEL);
if (!value) if (!value)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册