Re: [PATCH 3/3] fs/ntfs3: Refactoring of ntfs_set_ea

From: Joe Perches
Date: Fri Sep 24 2021 - 12:31:47 EST


On Fri, 2021-09-24 at 19:16 +0300, Konstantin Komarov wrote:
> Make code more readable.
> Don't try to read zero bytes.
> Add warning when size of exteneded attribute exceeds limit.
[]
> diff --git a/fs/ntfs3/xattr.c b/fs/ntfs3/xattr.c
[]
> @@ -366,21 +368,22 @@ static noinline int ntfs_set_ea(struct inode *inode, const char *name,
[]
> + ea_info.size = cpu_to_le32(size);
> +
> + /*
> + * 1. Check ea_info.size_pack for overflow.
> + * 2. New attibute size must fit value from $AttrDef
> + */
> + if (new_pack > 0xffff || size > sbi->ea_max_size) {
> + ntfs_inode_warn(
> + inode,
> + "The size of exteneded attributes must not exceed 64K");

trivial typo of extended. Pedants might suggest KiB.