linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kari Argillander <kari.argillander@gmail.com>
To: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
Cc: ntfs3@lists.linux.dev, linux-kernel@vger.kernel.org,
	linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH 1/3] fs/ntfs3: Fix insertion of attr in ni_ins_attr_ext
Date: Sat, 18 Sep 2021 10:02:46 +0300	[thread overview]
Message-ID: <20210918070246.rhbbvjwnwfnd4f7u@kari-VirtualBox> (raw)
In-Reply-To: <9fd8b3d5-2f1e-29c3-282a-d2276b5d0db9@paragon-software.com>

On Mon, Sep 13, 2021 at 06:12:58PM +0300, Konstantin Komarov wrote:
> Do not try to insert attribute if there is no room in record.
> 
> Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>

Reviewed-by: Kari Argillander <kari.argillander@gmail.com>

> ---
>  fs/ntfs3/frecord.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/fs/ntfs3/frecord.c b/fs/ntfs3/frecord.c
> index 938b12d56ca6..834cb361f61f 100644
> --- a/fs/ntfs3/frecord.c
> +++ b/fs/ntfs3/frecord.c
> @@ -956,6 +956,13 @@ 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.
> +		 */
> +		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.33.0
> 
> 

  reply	other threads:[~2021-09-18  7:03 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-13 15:09 [PATCH 0/3] fs/ntfs3: Speed up hardlink creation Konstantin Komarov
2021-09-13 15:12 ` [PATCH 1/3] fs/ntfs3: Fix insertion of attr in ni_ins_attr_ext Konstantin Komarov
2021-09-18  7:02   ` Kari Argillander [this message]
2021-09-13 15:14 ` [PATCH 2/3] fs/ntfs3: Change max hardlinks limit to 4000 Konstantin Komarov
2021-09-13 15:15 ` [PATCH 3/3] fs/ntfs3: Add sync flag to ntfs_sb_write_run and al_update Konstantin Komarov
2021-09-18  7:01 ` [PATCH 0/3] fs/ntfs3: Speed up hardlink creation Kari Argillander
  -- strict thread matches above, loose matches on Subject: below --
2021-09-09 10:57 [PATCH 1/3] fs/ntfs3: Fix insertion of attr in ni_ins_attr_ext Konstantin Komarov
2021-09-09 12:36 ` Kari Argillander

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210918070246.rhbbvjwnwfnd4f7u@kari-VirtualBox \
    --to=kari.argillander@gmail.com \
    --cc=almaz.alexandrovich@paragon-software.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ntfs3@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).