All of lore.kernel.org
 help / color / mirror / Atom feed
* [f2fs-dev] [PATCH v2] f2fs: compress: allow write compress released file after truncate to zero
@ 2021-07-02  3:11 Fengnan Chang
  2021-07-21  8:04 ` Fengnan Chang
  2021-07-22 13:26 ` Chao Yu
  0 siblings, 2 replies; 4+ messages in thread
From: Fengnan Chang @ 2021-07-02  3:11 UTC (permalink / raw)
  To: jaegeuk, chao, linux-f2fs-devel; +Cc: Fengnan Chang

We should allow write compress released file after truncate to zero.

Signed-off-by: Fengnan Chang <changfengnan@vivo.com>
---
 fs/f2fs/file.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
index 6afd4562335f..684fc2e8d8a4 100644
--- a/fs/f2fs/file.c
+++ b/fs/f2fs/file.c
@@ -740,6 +740,13 @@ int f2fs_truncate_blocks(struct inode *inode, u64 from, bool lock)
 		return err;
 
 #ifdef CONFIG_F2FS_FS_COMPRESSION
+	/*
+	 * We should allow write compress released file
+	 * after truncate to zero.
+	 */
+	if (f2fs_compressed_file(inode) && !free_from)
+		clear_inode_flag(inode, FI_COMPRESS_RELEASED);
+
 	if (from != free_from) {
 		err = f2fs_truncate_partial_cluster(inode, from, lock);
 		if (err)
-- 
2.29.0



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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [f2fs-dev] [PATCH v2] f2fs: compress: allow write compress released file after truncate to zero
  2021-07-02  3:11 [f2fs-dev] [PATCH v2] f2fs: compress: allow write compress released file after truncate to zero Fengnan Chang
@ 2021-07-21  8:04 ` Fengnan Chang
  2021-07-22 13:26 ` Chao Yu
  1 sibling, 0 replies; 4+ messages in thread
From: Fengnan Chang @ 2021-07-21  8:04 UTC (permalink / raw)
  To: jaegeuk, chao, linux-f2fs-devel

Hi jaegeuk,chao:

     How about this version ?


On 2021/7/2 11:11, Fengnan Chang wrote:
> We should allow write compress released file after truncate to zero.
> 
> Signed-off-by: Fengnan Chang <changfengnan@vivo.com>
> ---
>   fs/f2fs/file.c | 7 +++++++
>   1 file changed, 7 insertions(+)
> 
> diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
> index 6afd4562335f..684fc2e8d8a4 100644
> --- a/fs/f2fs/file.c
> +++ b/fs/f2fs/file.c
> @@ -740,6 +740,13 @@ int f2fs_truncate_blocks(struct inode *inode, u64 from, bool lock)
>   		return err;
>   
>   #ifdef CONFIG_F2FS_FS_COMPRESSION
> +	/*
> +	 * We should allow write compress released file
> +	 * after truncate to zero.
> +	 */
> +	if (f2fs_compressed_file(inode) && !free_from)
> +		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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [f2fs-dev] [PATCH v2] f2fs: compress: allow write compress released file after truncate to zero
  2021-07-02  3:11 [f2fs-dev] [PATCH v2] f2fs: compress: allow write compress released file after truncate to zero Fengnan Chang
  2021-07-21  8:04 ` Fengnan Chang
@ 2021-07-22 13:26 ` Chao Yu
  2021-07-23  2:32   ` Fengnan Chang
  1 sibling, 1 reply; 4+ messages in thread
From: Chao Yu @ 2021-07-22 13:26 UTC (permalink / raw)
  To: Fengnan Chang, jaegeuk, linux-f2fs-devel

On 2021/7/2 11:11, Fengnan Chang wrote:
> We should allow write compress released file after truncate to zero.
> 
> Signed-off-by: Fengnan Chang <changfengnan@vivo.com>
> ---
>   fs/f2fs/file.c | 7 +++++++
>   1 file changed, 7 insertions(+)
> 
> diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
> index 6afd4562335f..684fc2e8d8a4 100644
> --- a/fs/f2fs/file.c
> +++ b/fs/f2fs/file.c
> @@ -740,6 +740,13 @@ int f2fs_truncate_blocks(struct inode *inode, u64 from, bool lock)
>   		return err;
>   
>   #ifdef CONFIG_F2FS_FS_COMPRESSION
> +	/*
> +	 * We should allow write compress released file
> +	 * after truncate to zero.
> +	 */

Please document the behavior.

> +	if (f2fs_compressed_file(inode) && !free_from)

&& is_inode_flag_set(inode, FI_COMPRESS_RELEASED)

Thanks,

> +		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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [f2fs-dev] [PATCH v2] f2fs: compress: allow write compress released file after truncate to zero
  2021-07-22 13:26 ` Chao Yu
@ 2021-07-23  2:32   ` Fengnan Chang
  0 siblings, 0 replies; 4+ messages in thread
From: Fengnan Chang @ 2021-07-23  2:32 UTC (permalink / raw)
  To: Chao Yu, jaegeuk, linux-f2fs-devel

Thanks for your advise, I'll send new version later.


On 2021/7/22 21:26, Chao Yu wrote:
> On 2021/7/2 11:11, Fengnan Chang wrote:
>> We should allow write compress released file after truncate to zero.
>>
>> Signed-off-by: Fengnan Chang <changfengnan@vivo.com>
>> ---
>>   fs/f2fs/file.c | 7 +++++++
>>   1 file changed, 7 insertions(+)
>>
>> diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
>> index 6afd4562335f..684fc2e8d8a4 100644
>> --- a/fs/f2fs/file.c
>> +++ b/fs/f2fs/file.c
>> @@ -740,6 +740,13 @@ int f2fs_truncate_blocks(struct inode *inode, u64 
>> from, bool lock)
>>           return err;
>>   #ifdef CONFIG_F2FS_FS_COMPRESSION
>> +    /*
>> +     * We should allow write compress released file
>> +     * after truncate to zero.
>> +     */
> 
> Please document the behavior.
> 
>> +    if (f2fs_compressed_file(inode) && !free_from)
> 
> && is_inode_flag_set(inode, FI_COMPRESS_RELEASED)
> 
> Thanks,
> 
>> +        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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-07-23  2:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-02  3:11 [f2fs-dev] [PATCH v2] f2fs: compress: allow write compress released file after truncate to zero Fengnan Chang
2021-07-21  8:04 ` Fengnan Chang
2021-07-22 13:26 ` Chao Yu
2021-07-23  2:32   ` Fengnan Chang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.