linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
From: Chao Yu <chao@kernel.org>
To: Fengnan Chang <changfengnan@vivo.com>,
	jaegeuk@kernel.org, linux-f2fs-devel@lists.sourceforge.net
Subject: Re: [f2fs-dev] [PATCH v3] f2fs: compress: allow write compress released file after truncate to zero
Date: Fri, 6 Aug 2021 16:42:57 +0800	[thread overview]
Message-ID: <b83932b4-a727-b085-692b-49c50f7caa4f@kernel.org> (raw)
In-Reply-To: <a906c95e-3b7f-fe0e-d016-ae6e76564dc8@vivo.com>

On 2021/8/6 16:35, Fengnan Chang wrote:
> Um.. I think this version should be ok.

Well, actually, I mean adding description of this behavior into compression
section of f2fs.rst.

https://elixir.bootlin.com/linux/latest/source/Documentation/filesystems/f2fs.rst#L829

Thanks,

> 
> Thanks.
> 
> On 2021/7/23 10:31, Fengnan Chang wrote:
>> For compressed file, after release compress blocks, don't allow write
>> direct, but we should allow write direct after truncate to zero.
>>
>> Signed-off-by: Fengnan Chang <changfengnan@vivo.com>
>> ---
>>    fs/f2fs/file.c | 8 ++++++++
>>    1 file changed, 8 insertions(+)
>>
>> diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
>> index 6afd4562335f..094f6546fd00 100644
>> --- a/fs/f2fs/file.c
>> +++ b/fs/f2fs/file.c
>> @@ -740,6 +740,14 @@ int f2fs_truncate_blocks(struct inode *inode, u64 from, bool lock)
>>    		return err;
>>    
>>    #ifdef CONFIG_F2FS_FS_COMPRESSION
>> +	/*
>> +	 * For compressed file, after release compress blocks, don't allow write
>> +	 * direct, but we should allow write direct after truncate to zero.
>> +	 */
>> +	if (f2fs_compressed_file(inode) && !free_from
>> +			&& is_inode_flag_set(inode, FI_COMPRESS_RELEASED))
>> +		clear_inode_flag(inode, FI_COMPRESS_RELEASED);
>> +
>>    	if (from != free_from) {
>>    		err = f2fs_truncate_partial_cluster(inode, from, lock);
>>    		if (err)
>>


_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

      reply	other threads:[~2021-08-06  8:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-23  2:31 [f2fs-dev] [PATCH v3] f2fs: compress: allow write compress released file after truncate to zero Fengnan Chang
2021-08-06  8:35 ` Fengnan Chang
2021-08-06  8:42   ` Chao Yu [this message]

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=b83932b4-a727-b085-692b-49c50f7caa4f@kernel.org \
    --to=chao@kernel.org \
    --cc=changfengnan@vivo.com \
    --cc=jaegeuk@kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    /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).