[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20210909123628.m5agndj35sesdurv@kari-VirtualBox>
Date: Thu, 9 Sep 2021 15:36:28 +0300
From: Kari Argillander <kari.argillander@...il.com>
To: Konstantin Komarov <almaz.alexandrovich@...agon-software.com>
Cc: ntfs3@...ts.linux.dev, linux-kernel@...r.kernel.org,
linux-fsdevel@...r.kernel.org
Subject: Re: [PATCH 1/3] fs/ntfs3: Fix insertion of attr in ni_ins_attr_ext
On Thu, Sep 09, 2021 at 01:57:59PM +0300, Konstantin Komarov wrote:
> Do not try to insert attribute if there is no room in record.
>
> Signed-off-by: Konstantin Komarov <almaz.alexandrovich@...agon-software.com>
> ---
> fs/ntfs3/frecord.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/fs/ntfs3/frecord.c b/fs/ntfs3/frecord.c
> index 938b12d56ca6..5dd7b7a7c5e0 100644
> --- a/fs/ntfs3/frecord.c
> +++ b/fs/ntfs3/frecord.c
> @@ -956,6 +956,10 @@ static int ni_ins_attr_ext(struct ntfs_inode *ni, struct ATTR_LIST_ENTRY *le,
> continue;
> }
>
> + /* Do not try to insert this attribute if there is no room in record. */
Multiline comment as this gets very long.
> + if (le32_to_cpu(mi->mrec->used) + asize > sbi->record_size)
> + continue;
> +
> /* Try to insert attribute into this subrecord. */
> attr = ni_ins_new_attr(ni, mi, le, type, name, name_len, asize,
> name_off, svcn, ins_le);
> --
> 2.28.0
Powered by blists - more mailing lists