public inbox for ntfs3@lists.linux.dev
 help / color / mirror / Atom feed
From: Kari Argillander <kari.argillander@gmail.com>
To: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>,
	hgkamath@hotmail.com
Cc: ntfs3@lists.linux.dev, linux-kernel@vger.kernel.org,
	linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH 1/4] fs/ntfs3: Keep preallocated only if option prealloc enabled
Date: Sat, 23 Oct 2021 12:55:59 +0300	[thread overview]
Message-ID: <20211023095559.ythxb2z2ptdrlr5s@kari-VirtualBox> (raw)
In-Reply-To: <aaf41f35-b702-b391-1cff-de4688b3bb65@paragon-software.com>

On Fri, Oct 22, 2021 at 06:54:31PM +0300, Konstantin Komarov wrote:
> If size of file was reduced, we still kept allocated blocks.
> This commit makes ntfs3 work as other fs like btrfs.
> https://bugzilla.kernel.org/show_bug.cgi?id=214719

Link: https://bugzilla.kernel.org/show_bug.cgi?id=214719
> Fixes: 4342306f0f0d ("fs/ntfs3: Add file operations and implementation")
> 
> Reported-by: Ganapathi Kamath

Add <hgkamath@hotmail.com>

I also added to loop here. Ganapathi can you test if this patch fix your
problem?

> Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
> ---
>  fs/ntfs3/file.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/ntfs3/file.c b/fs/ntfs3/file.c
> index 43b1451bff53..3ac0482c6880 100644
> --- a/fs/ntfs3/file.c
> +++ b/fs/ntfs3/file.c
> @@ -494,7 +494,7 @@ static int ntfs_truncate(struct inode *inode, loff_t new_size)
>  
>  	down_write(&ni->file.run_lock);
>  	err = attr_set_size(ni, ATTR_DATA, NULL, 0, &ni->file.run, new_size,
> -			    &new_valid, true, NULL);
> +			    &new_valid, ni->mi.sbi->options->prealloc, NULL);
>  	up_write(&ni->file.run_lock);
>  
>  	if (new_valid < ni->i_valid)
> -- 
> 2.33.0
> 
> 

  reply	other threads:[~2021-10-23  9:56 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-22 15:53 [PATCH 0/4] fs/ntfs3: Various fixes for xattr and files Konstantin Komarov
2021-10-22 15:54 ` [PATCH 1/4] fs/ntfs3: Keep preallocated only if option prealloc enabled Konstantin Komarov
2021-10-23  9:55   ` Kari Argillander [this message]
2021-10-24  8:35     ` Ganapathi Kamath
2021-10-24 10:43       ` Kari Argillander
2021-10-24 11:13         ` Ganapathi Kamath
2021-10-22 15:55 ` [PATCH 2/4] fs/ntfs3: Restore ntfs_xattr_get_acl and ntfs_xattr_set_acl functions Konstantin Komarov
2021-10-23  9:34   ` Kari Argillander
2021-10-22 15:55 ` [PATCH 3/4] fs/ntfs3: Optimize locking in ntfs_save_wsl_perm Konstantin Komarov
2021-10-22 16:22   ` Joe Perches
2021-10-22 15:56 ` [PATCH 4/4] fs/ntfs3: Update i_ctime when xattr is added Konstantin Komarov
2021-10-23  9:40   ` Kari Argillander
  -- strict thread matches above, loose matches on Subject: below --
2021-10-26 16:40 [PATCH v2 0/4] fs/ntfs3: Various fixes for xattr and files Konstantin Komarov
2021-10-26 16:40 ` [PATCH 1/4] fs/ntfs3: Keep preallocated only if option prealloc enabled Konstantin Komarov
2021-10-26 18:17   ` 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=20211023095559.ythxb2z2ptdrlr5s@kari-VirtualBox \
    --to=kari.argillander@gmail.com \
    --cc=almaz.alexandrovich@paragon-software.com \
    --cc=hgkamath@hotmail.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