All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] f2fs: avoid attaching SB_ACTIVE flag during mount
@ 2021-09-01  8:06 ` Chao Yu
  0 siblings, 0 replies; 8+ messages in thread
From: Chao Yu @ 2021-09-01  8:06 UTC (permalink / raw)
  To: jaegeuk
  Cc: linux-f2fs-devel, linux-kernel, Chao Yu, Chao Yu, Zhang Yi, Jan Kara

Quoted from [1]

"I do remember that I've added this code back then because otherwise
orphan cleanup was losing updates to quota files. But you're right
that now I don't see how that could be happening and it would be nice
if we could get rid of this hack"

[1] https://lore.kernel.org/linux-ext4/99cce8ca-e4a0-7301-840f-2ace67c551f3@huawei.com/T/#m04990cfbc4f44592421736b504afcc346b2a7c00

Related fix in ext4 by
commit 72ffb49a7b62 ("ext4: do not set SB_ACTIVE in ext4_orphan_cleanup()").

f2fs has the same hack implementation in
- f2fs_recover_orphan_inodes()
- f2fs_recover_fsync_data()

Let's get rid of this hack as well in f2fs.

Cc: Zhang Yi <yi.zhang@huawei.com>
Cc: Jan Kara <jack@suse.cz>
Acked-by: Jan Kara <jack@suse.cz>
Signed-off-by: Chao Yu <chao@kernel.org>
---
v2:
- don't bother checkpoint disabling path
 fs/f2fs/checkpoint.c | 3 ---
 fs/f2fs/recovery.c   | 8 ++------
 2 files changed, 2 insertions(+), 9 deletions(-)

diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c
index 83e9bc0f91ff..7d8803a4cbc2 100644
--- a/fs/f2fs/checkpoint.c
+++ b/fs/f2fs/checkpoint.c
@@ -705,9 +705,6 @@ int f2fs_recover_orphan_inodes(struct f2fs_sb_info *sbi)
 	}
 
 #ifdef CONFIG_QUOTA
-	/* Needed for iput() to work correctly and not trash data */
-	sbi->sb->s_flags |= SB_ACTIVE;
-
 	/*
 	 * Turn on quotas which were not enabled for read-only mounts if
 	 * filesystem has quota feature, so that they are updated correctly.
diff --git a/fs/f2fs/recovery.c b/fs/f2fs/recovery.c
index 04655511d7f5..706ddb3c95c0 100644
--- a/fs/f2fs/recovery.c
+++ b/fs/f2fs/recovery.c
@@ -787,8 +787,6 @@ int f2fs_recover_fsync_data(struct f2fs_sb_info *sbi, bool check_only)
 	}
 
 #ifdef CONFIG_QUOTA
-	/* Needed for iput() to work correctly and not trash data */
-	sbi->sb->s_flags |= SB_ACTIVE;
 	/* Turn on quotas so that they are updated correctly */
 	quota_enabled = f2fs_enable_quota_files(sbi, s_flags & SB_RDONLY);
 #endif
@@ -816,10 +814,8 @@ int f2fs_recover_fsync_data(struct f2fs_sb_info *sbi, bool check_only)
 	err = recover_data(sbi, &inode_list, &tmp_inode_list, &dir_list);
 	if (!err)
 		f2fs_bug_on(sbi, !list_empty(&inode_list));
-	else {
-		/* restore s_flags to let iput() trash data */
-		sbi->sb->s_flags = s_flags;
-	}
+	else
+		f2fs_bug_on(sbi, sbi->sb->s_flags & SB_ACTIVE);
 skip:
 	fix_curseg_write_pointer = !check_only || list_empty(&inode_list);
 
-- 
2.32.0


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

* [f2fs-dev] [PATCH v2] f2fs: avoid attaching SB_ACTIVE flag during mount
@ 2021-09-01  8:06 ` Chao Yu
  0 siblings, 0 replies; 8+ messages in thread
From: Chao Yu @ 2021-09-01  8:06 UTC (permalink / raw)
  To: jaegeuk; +Cc: Jan Kara, Zhang Yi, Chao Yu, linux-kernel, linux-f2fs-devel

Quoted from [1]

"I do remember that I've added this code back then because otherwise
orphan cleanup was losing updates to quota files. But you're right
that now I don't see how that could be happening and it would be nice
if we could get rid of this hack"

[1] https://lore.kernel.org/linux-ext4/99cce8ca-e4a0-7301-840f-2ace67c551f3@huawei.com/T/#m04990cfbc4f44592421736b504afcc346b2a7c00

Related fix in ext4 by
commit 72ffb49a7b62 ("ext4: do not set SB_ACTIVE in ext4_orphan_cleanup()").

f2fs has the same hack implementation in
- f2fs_recover_orphan_inodes()
- f2fs_recover_fsync_data()

Let's get rid of this hack as well in f2fs.

Cc: Zhang Yi <yi.zhang@huawei.com>
Cc: Jan Kara <jack@suse.cz>
Acked-by: Jan Kara <jack@suse.cz>
Signed-off-by: Chao Yu <chao@kernel.org>
---
v2:
- don't bother checkpoint disabling path
 fs/f2fs/checkpoint.c | 3 ---
 fs/f2fs/recovery.c   | 8 ++------
 2 files changed, 2 insertions(+), 9 deletions(-)

diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c
index 83e9bc0f91ff..7d8803a4cbc2 100644
--- a/fs/f2fs/checkpoint.c
+++ b/fs/f2fs/checkpoint.c
@@ -705,9 +705,6 @@ int f2fs_recover_orphan_inodes(struct f2fs_sb_info *sbi)
 	}
 
 #ifdef CONFIG_QUOTA
-	/* Needed for iput() to work correctly and not trash data */
-	sbi->sb->s_flags |= SB_ACTIVE;
-
 	/*
 	 * Turn on quotas which were not enabled for read-only mounts if
 	 * filesystem has quota feature, so that they are updated correctly.
diff --git a/fs/f2fs/recovery.c b/fs/f2fs/recovery.c
index 04655511d7f5..706ddb3c95c0 100644
--- a/fs/f2fs/recovery.c
+++ b/fs/f2fs/recovery.c
@@ -787,8 +787,6 @@ int f2fs_recover_fsync_data(struct f2fs_sb_info *sbi, bool check_only)
 	}
 
 #ifdef CONFIG_QUOTA
-	/* Needed for iput() to work correctly and not trash data */
-	sbi->sb->s_flags |= SB_ACTIVE;
 	/* Turn on quotas so that they are updated correctly */
 	quota_enabled = f2fs_enable_quota_files(sbi, s_flags & SB_RDONLY);
 #endif
@@ -816,10 +814,8 @@ int f2fs_recover_fsync_data(struct f2fs_sb_info *sbi, bool check_only)
 	err = recover_data(sbi, &inode_list, &tmp_inode_list, &dir_list);
 	if (!err)
 		f2fs_bug_on(sbi, !list_empty(&inode_list));
-	else {
-		/* restore s_flags to let iput() trash data */
-		sbi->sb->s_flags = s_flags;
-	}
+	else
+		f2fs_bug_on(sbi, sbi->sb->s_flags & SB_ACTIVE);
 skip:
 	fix_curseg_write_pointer = !check_only || list_empty(&inode_list);
 
-- 
2.32.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] 8+ messages in thread

* Re: [PATCH v2] f2fs: avoid attaching SB_ACTIVE flag during mount
  2021-09-01  8:06 ` [f2fs-dev] " Chao Yu
@ 2021-09-04  0:17   ` Jaegeuk Kim
  -1 siblings, 0 replies; 8+ messages in thread
From: Jaegeuk Kim @ 2021-09-04  0:17 UTC (permalink / raw)
  To: Chao Yu; +Cc: linux-f2fs-devel, linux-kernel, Chao Yu, Zhang Yi, Jan Kara

I remember this gave a regression before?

On 09/01, Chao Yu wrote:
> Quoted from [1]
> 
> "I do remember that I've added this code back then because otherwise
> orphan cleanup was losing updates to quota files. But you're right
> that now I don't see how that could be happening and it would be nice
> if we could get rid of this hack"
> 
> [1] https://lore.kernel.org/linux-ext4/99cce8ca-e4a0-7301-840f-2ace67c551f3@huawei.com/T/#m04990cfbc4f44592421736b504afcc346b2a7c00
> 
> Related fix in ext4 by
> commit 72ffb49a7b62 ("ext4: do not set SB_ACTIVE in ext4_orphan_cleanup()").
> 
> f2fs has the same hack implementation in
> - f2fs_recover_orphan_inodes()
> - f2fs_recover_fsync_data()
> 
> Let's get rid of this hack as well in f2fs.
> 
> Cc: Zhang Yi <yi.zhang@huawei.com>
> Cc: Jan Kara <jack@suse.cz>
> Acked-by: Jan Kara <jack@suse.cz>
> Signed-off-by: Chao Yu <chao@kernel.org>
> ---
> v2:
> - don't bother checkpoint disabling path
>  fs/f2fs/checkpoint.c | 3 ---
>  fs/f2fs/recovery.c   | 8 ++------
>  2 files changed, 2 insertions(+), 9 deletions(-)
> 
> diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c
> index 83e9bc0f91ff..7d8803a4cbc2 100644
> --- a/fs/f2fs/checkpoint.c
> +++ b/fs/f2fs/checkpoint.c
> @@ -705,9 +705,6 @@ int f2fs_recover_orphan_inodes(struct f2fs_sb_info *sbi)
>  	}
>  
>  #ifdef CONFIG_QUOTA
> -	/* Needed for iput() to work correctly and not trash data */
> -	sbi->sb->s_flags |= SB_ACTIVE;
> -
>  	/*
>  	 * Turn on quotas which were not enabled for read-only mounts if
>  	 * filesystem has quota feature, so that they are updated correctly.
> diff --git a/fs/f2fs/recovery.c b/fs/f2fs/recovery.c
> index 04655511d7f5..706ddb3c95c0 100644
> --- a/fs/f2fs/recovery.c
> +++ b/fs/f2fs/recovery.c
> @@ -787,8 +787,6 @@ int f2fs_recover_fsync_data(struct f2fs_sb_info *sbi, bool check_only)
>  	}
>  
>  #ifdef CONFIG_QUOTA
> -	/* Needed for iput() to work correctly and not trash data */
> -	sbi->sb->s_flags |= SB_ACTIVE;
>  	/* Turn on quotas so that they are updated correctly */
>  	quota_enabled = f2fs_enable_quota_files(sbi, s_flags & SB_RDONLY);
>  #endif
> @@ -816,10 +814,8 @@ int f2fs_recover_fsync_data(struct f2fs_sb_info *sbi, bool check_only)
>  	err = recover_data(sbi, &inode_list, &tmp_inode_list, &dir_list);
>  	if (!err)
>  		f2fs_bug_on(sbi, !list_empty(&inode_list));
> -	else {
> -		/* restore s_flags to let iput() trash data */
> -		sbi->sb->s_flags = s_flags;
> -	}
> +	else
> +		f2fs_bug_on(sbi, sbi->sb->s_flags & SB_ACTIVE);
>  skip:
>  	fix_curseg_write_pointer = !check_only || list_empty(&inode_list);
>  
> -- 
> 2.32.0

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

* Re: [f2fs-dev] [PATCH v2] f2fs: avoid attaching SB_ACTIVE flag during mount
@ 2021-09-04  0:17   ` Jaegeuk Kim
  0 siblings, 0 replies; 8+ messages in thread
From: Jaegeuk Kim @ 2021-09-04  0:17 UTC (permalink / raw)
  To: Chao Yu; +Cc: Zhang Yi, Chao Yu, Jan Kara, linux-kernel, linux-f2fs-devel

I remember this gave a regression before?

On 09/01, Chao Yu wrote:
> Quoted from [1]
> 
> "I do remember that I've added this code back then because otherwise
> orphan cleanup was losing updates to quota files. But you're right
> that now I don't see how that could be happening and it would be nice
> if we could get rid of this hack"
> 
> [1] https://lore.kernel.org/linux-ext4/99cce8ca-e4a0-7301-840f-2ace67c551f3@huawei.com/T/#m04990cfbc4f44592421736b504afcc346b2a7c00
> 
> Related fix in ext4 by
> commit 72ffb49a7b62 ("ext4: do not set SB_ACTIVE in ext4_orphan_cleanup()").
> 
> f2fs has the same hack implementation in
> - f2fs_recover_orphan_inodes()
> - f2fs_recover_fsync_data()
> 
> Let's get rid of this hack as well in f2fs.
> 
> Cc: Zhang Yi <yi.zhang@huawei.com>
> Cc: Jan Kara <jack@suse.cz>
> Acked-by: Jan Kara <jack@suse.cz>
> Signed-off-by: Chao Yu <chao@kernel.org>
> ---
> v2:
> - don't bother checkpoint disabling path
>  fs/f2fs/checkpoint.c | 3 ---
>  fs/f2fs/recovery.c   | 8 ++------
>  2 files changed, 2 insertions(+), 9 deletions(-)
> 
> diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c
> index 83e9bc0f91ff..7d8803a4cbc2 100644
> --- a/fs/f2fs/checkpoint.c
> +++ b/fs/f2fs/checkpoint.c
> @@ -705,9 +705,6 @@ int f2fs_recover_orphan_inodes(struct f2fs_sb_info *sbi)
>  	}
>  
>  #ifdef CONFIG_QUOTA
> -	/* Needed for iput() to work correctly and not trash data */
> -	sbi->sb->s_flags |= SB_ACTIVE;
> -
>  	/*
>  	 * Turn on quotas which were not enabled for read-only mounts if
>  	 * filesystem has quota feature, so that they are updated correctly.
> diff --git a/fs/f2fs/recovery.c b/fs/f2fs/recovery.c
> index 04655511d7f5..706ddb3c95c0 100644
> --- a/fs/f2fs/recovery.c
> +++ b/fs/f2fs/recovery.c
> @@ -787,8 +787,6 @@ int f2fs_recover_fsync_data(struct f2fs_sb_info *sbi, bool check_only)
>  	}
>  
>  #ifdef CONFIG_QUOTA
> -	/* Needed for iput() to work correctly and not trash data */
> -	sbi->sb->s_flags |= SB_ACTIVE;
>  	/* Turn on quotas so that they are updated correctly */
>  	quota_enabled = f2fs_enable_quota_files(sbi, s_flags & SB_RDONLY);
>  #endif
> @@ -816,10 +814,8 @@ int f2fs_recover_fsync_data(struct f2fs_sb_info *sbi, bool check_only)
>  	err = recover_data(sbi, &inode_list, &tmp_inode_list, &dir_list);
>  	if (!err)
>  		f2fs_bug_on(sbi, !list_empty(&inode_list));
> -	else {
> -		/* restore s_flags to let iput() trash data */
> -		sbi->sb->s_flags = s_flags;
> -	}
> +	else
> +		f2fs_bug_on(sbi, sbi->sb->s_flags & SB_ACTIVE);
>  skip:
>  	fix_curseg_write_pointer = !check_only || list_empty(&inode_list);
>  
> -- 
> 2.32.0


_______________________________________________
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] 8+ messages in thread

* Re: [PATCH v2] f2fs: avoid attaching SB_ACTIVE flag during mount
  2021-09-04  0:17   ` [f2fs-dev] " Jaegeuk Kim
@ 2021-09-04  3:06     ` Chao Yu
  -1 siblings, 0 replies; 8+ messages in thread
From: Chao Yu @ 2021-09-04  3:06 UTC (permalink / raw)
  To: Jaegeuk Kim; +Cc: linux-f2fs-devel, linux-kernel, Zhang Yi, Jan Kara

On 2021/9/4 8:17, Jaegeuk Kim wrote:
> I remember this gave a regression before?

I have removed changes which bothers checkpoint disabling path, how
about testing this in dev-test branch for a while?

BTW, any plan to porting checkpoint disabling testcases from android
into xfstest suit?

Thanks,

> 
> On 09/01, Chao Yu wrote:
>> Quoted from [1]
>>
>> "I do remember that I've added this code back then because otherwise
>> orphan cleanup was losing updates to quota files. But you're right
>> that now I don't see how that could be happening and it would be nice
>> if we could get rid of this hack"
>>
>> [1] https://lore.kernel.org/linux-ext4/99cce8ca-e4a0-7301-840f-2ace67c551f3@huawei.com/T/#m04990cfbc4f44592421736b504afcc346b2a7c00
>>
>> Related fix in ext4 by
>> commit 72ffb49a7b62 ("ext4: do not set SB_ACTIVE in ext4_orphan_cleanup()").
>>
>> f2fs has the same hack implementation in
>> - f2fs_recover_orphan_inodes()
>> - f2fs_recover_fsync_data()
>>
>> Let's get rid of this hack as well in f2fs.
>>
>> Cc: Zhang Yi <yi.zhang@huawei.com>
>> Cc: Jan Kara <jack@suse.cz>
>> Acked-by: Jan Kara <jack@suse.cz>
>> Signed-off-by: Chao Yu <chao@kernel.org>
>> ---
>> v2:
>> - don't bother checkpoint disabling path
>>   fs/f2fs/checkpoint.c | 3 ---
>>   fs/f2fs/recovery.c   | 8 ++------
>>   2 files changed, 2 insertions(+), 9 deletions(-)
>>
>> diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c
>> index 83e9bc0f91ff..7d8803a4cbc2 100644
>> --- a/fs/f2fs/checkpoint.c
>> +++ b/fs/f2fs/checkpoint.c
>> @@ -705,9 +705,6 @@ int f2fs_recover_orphan_inodes(struct f2fs_sb_info *sbi)
>>   	}
>>   
>>   #ifdef CONFIG_QUOTA
>> -	/* Needed for iput() to work correctly and not trash data */
>> -	sbi->sb->s_flags |= SB_ACTIVE;
>> -
>>   	/*
>>   	 * Turn on quotas which were not enabled for read-only mounts if
>>   	 * filesystem has quota feature, so that they are updated correctly.
>> diff --git a/fs/f2fs/recovery.c b/fs/f2fs/recovery.c
>> index 04655511d7f5..706ddb3c95c0 100644
>> --- a/fs/f2fs/recovery.c
>> +++ b/fs/f2fs/recovery.c
>> @@ -787,8 +787,6 @@ int f2fs_recover_fsync_data(struct f2fs_sb_info *sbi, bool check_only)
>>   	}
>>   
>>   #ifdef CONFIG_QUOTA
>> -	/* Needed for iput() to work correctly and not trash data */
>> -	sbi->sb->s_flags |= SB_ACTIVE;
>>   	/* Turn on quotas so that they are updated correctly */
>>   	quota_enabled = f2fs_enable_quota_files(sbi, s_flags & SB_RDONLY);
>>   #endif
>> @@ -816,10 +814,8 @@ int f2fs_recover_fsync_data(struct f2fs_sb_info *sbi, bool check_only)
>>   	err = recover_data(sbi, &inode_list, &tmp_inode_list, &dir_list);
>>   	if (!err)
>>   		f2fs_bug_on(sbi, !list_empty(&inode_list));
>> -	else {
>> -		/* restore s_flags to let iput() trash data */
>> -		sbi->sb->s_flags = s_flags;
>> -	}
>> +	else
>> +		f2fs_bug_on(sbi, sbi->sb->s_flags & SB_ACTIVE);
>>   skip:
>>   	fix_curseg_write_pointer = !check_only || list_empty(&inode_list);
>>   
>> -- 
>> 2.32.0

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

* Re: [f2fs-dev] [PATCH v2] f2fs: avoid attaching SB_ACTIVE flag during mount
@ 2021-09-04  3:06     ` Chao Yu
  0 siblings, 0 replies; 8+ messages in thread
From: Chao Yu @ 2021-09-04  3:06 UTC (permalink / raw)
  To: Jaegeuk Kim; +Cc: Zhang Yi, Jan Kara, linux-kernel, linux-f2fs-devel

On 2021/9/4 8:17, Jaegeuk Kim wrote:
> I remember this gave a regression before?

I have removed changes which bothers checkpoint disabling path, how
about testing this in dev-test branch for a while?

BTW, any plan to porting checkpoint disabling testcases from android
into xfstest suit?

Thanks,

> 
> On 09/01, Chao Yu wrote:
>> Quoted from [1]
>>
>> "I do remember that I've added this code back then because otherwise
>> orphan cleanup was losing updates to quota files. But you're right
>> that now I don't see how that could be happening and it would be nice
>> if we could get rid of this hack"
>>
>> [1] https://lore.kernel.org/linux-ext4/99cce8ca-e4a0-7301-840f-2ace67c551f3@huawei.com/T/#m04990cfbc4f44592421736b504afcc346b2a7c00
>>
>> Related fix in ext4 by
>> commit 72ffb49a7b62 ("ext4: do not set SB_ACTIVE in ext4_orphan_cleanup()").
>>
>> f2fs has the same hack implementation in
>> - f2fs_recover_orphan_inodes()
>> - f2fs_recover_fsync_data()
>>
>> Let's get rid of this hack as well in f2fs.
>>
>> Cc: Zhang Yi <yi.zhang@huawei.com>
>> Cc: Jan Kara <jack@suse.cz>
>> Acked-by: Jan Kara <jack@suse.cz>
>> Signed-off-by: Chao Yu <chao@kernel.org>
>> ---
>> v2:
>> - don't bother checkpoint disabling path
>>   fs/f2fs/checkpoint.c | 3 ---
>>   fs/f2fs/recovery.c   | 8 ++------
>>   2 files changed, 2 insertions(+), 9 deletions(-)
>>
>> diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c
>> index 83e9bc0f91ff..7d8803a4cbc2 100644
>> --- a/fs/f2fs/checkpoint.c
>> +++ b/fs/f2fs/checkpoint.c
>> @@ -705,9 +705,6 @@ int f2fs_recover_orphan_inodes(struct f2fs_sb_info *sbi)
>>   	}
>>   
>>   #ifdef CONFIG_QUOTA
>> -	/* Needed for iput() to work correctly and not trash data */
>> -	sbi->sb->s_flags |= SB_ACTIVE;
>> -
>>   	/*
>>   	 * Turn on quotas which were not enabled for read-only mounts if
>>   	 * filesystem has quota feature, so that they are updated correctly.
>> diff --git a/fs/f2fs/recovery.c b/fs/f2fs/recovery.c
>> index 04655511d7f5..706ddb3c95c0 100644
>> --- a/fs/f2fs/recovery.c
>> +++ b/fs/f2fs/recovery.c
>> @@ -787,8 +787,6 @@ int f2fs_recover_fsync_data(struct f2fs_sb_info *sbi, bool check_only)
>>   	}
>>   
>>   #ifdef CONFIG_QUOTA
>> -	/* Needed for iput() to work correctly and not trash data */
>> -	sbi->sb->s_flags |= SB_ACTIVE;
>>   	/* Turn on quotas so that they are updated correctly */
>>   	quota_enabled = f2fs_enable_quota_files(sbi, s_flags & SB_RDONLY);
>>   #endif
>> @@ -816,10 +814,8 @@ int f2fs_recover_fsync_data(struct f2fs_sb_info *sbi, bool check_only)
>>   	err = recover_data(sbi, &inode_list, &tmp_inode_list, &dir_list);
>>   	if (!err)
>>   		f2fs_bug_on(sbi, !list_empty(&inode_list));
>> -	else {
>> -		/* restore s_flags to let iput() trash data */
>> -		sbi->sb->s_flags = s_flags;
>> -	}
>> +	else
>> +		f2fs_bug_on(sbi, sbi->sb->s_flags & SB_ACTIVE);
>>   skip:
>>   	fix_curseg_write_pointer = !check_only || list_empty(&inode_list);
>>   
>> -- 
>> 2.32.0


_______________________________________________
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] 8+ messages in thread

* Re: [PATCH v2] f2fs: avoid attaching SB_ACTIVE flag during mount
  2021-09-04  3:06     ` [f2fs-dev] " Chao Yu
@ 2021-09-10 22:06       ` Jaegeuk Kim
  -1 siblings, 0 replies; 8+ messages in thread
From: Jaegeuk Kim @ 2021-09-10 22:06 UTC (permalink / raw)
  To: Chao Yu; +Cc: linux-f2fs-devel, linux-kernel, Zhang Yi, Jan Kara

On 09/04, Chao Yu wrote:
> On 2021/9/4 8:17, Jaegeuk Kim wrote:
> > I remember this gave a regression before?
> 
> I have removed changes which bothers checkpoint disabling path, how
> about testing this in dev-test branch for a while?

Let me give it a try.

> 
> BTW, any plan to porting checkpoint disabling testcases from android
> into xfstest suit?

No.

> 
> Thanks,
> 
> > 
> > On 09/01, Chao Yu wrote:
> > > Quoted from [1]
> > > 
> > > "I do remember that I've added this code back then because otherwise
> > > orphan cleanup was losing updates to quota files. But you're right
> > > that now I don't see how that could be happening and it would be nice
> > > if we could get rid of this hack"
> > > 
> > > [1] https://lore.kernel.org/linux-ext4/99cce8ca-e4a0-7301-840f-2ace67c551f3@huawei.com/T/#m04990cfbc4f44592421736b504afcc346b2a7c00
> > > 
> > > Related fix in ext4 by
> > > commit 72ffb49a7b62 ("ext4: do not set SB_ACTIVE in ext4_orphan_cleanup()").
> > > 
> > > f2fs has the same hack implementation in
> > > - f2fs_recover_orphan_inodes()
> > > - f2fs_recover_fsync_data()
> > > 
> > > Let's get rid of this hack as well in f2fs.
> > > 
> > > Cc: Zhang Yi <yi.zhang@huawei.com>
> > > Cc: Jan Kara <jack@suse.cz>
> > > Acked-by: Jan Kara <jack@suse.cz>
> > > Signed-off-by: Chao Yu <chao@kernel.org>
> > > ---
> > > v2:
> > > - don't bother checkpoint disabling path
> > >   fs/f2fs/checkpoint.c | 3 ---
> > >   fs/f2fs/recovery.c   | 8 ++------
> > >   2 files changed, 2 insertions(+), 9 deletions(-)
> > > 
> > > diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c
> > > index 83e9bc0f91ff..7d8803a4cbc2 100644
> > > --- a/fs/f2fs/checkpoint.c
> > > +++ b/fs/f2fs/checkpoint.c
> > > @@ -705,9 +705,6 @@ int f2fs_recover_orphan_inodes(struct f2fs_sb_info *sbi)
> > >   	}
> > >   #ifdef CONFIG_QUOTA
> > > -	/* Needed for iput() to work correctly and not trash data */
> > > -	sbi->sb->s_flags |= SB_ACTIVE;
> > > -
> > >   	/*
> > >   	 * Turn on quotas which were not enabled for read-only mounts if
> > >   	 * filesystem has quota feature, so that they are updated correctly.
> > > diff --git a/fs/f2fs/recovery.c b/fs/f2fs/recovery.c
> > > index 04655511d7f5..706ddb3c95c0 100644
> > > --- a/fs/f2fs/recovery.c
> > > +++ b/fs/f2fs/recovery.c
> > > @@ -787,8 +787,6 @@ int f2fs_recover_fsync_data(struct f2fs_sb_info *sbi, bool check_only)
> > >   	}
> > >   #ifdef CONFIG_QUOTA
> > > -	/* Needed for iput() to work correctly and not trash data */
> > > -	sbi->sb->s_flags |= SB_ACTIVE;
> > >   	/* Turn on quotas so that they are updated correctly */
> > >   	quota_enabled = f2fs_enable_quota_files(sbi, s_flags & SB_RDONLY);
> > >   #endif
> > > @@ -816,10 +814,8 @@ int f2fs_recover_fsync_data(struct f2fs_sb_info *sbi, bool check_only)
> > >   	err = recover_data(sbi, &inode_list, &tmp_inode_list, &dir_list);
> > >   	if (!err)
> > >   		f2fs_bug_on(sbi, !list_empty(&inode_list));
> > > -	else {
> > > -		/* restore s_flags to let iput() trash data */
> > > -		sbi->sb->s_flags = s_flags;
> > > -	}
> > > +	else
> > > +		f2fs_bug_on(sbi, sbi->sb->s_flags & SB_ACTIVE);
> > >   skip:
> > >   	fix_curseg_write_pointer = !check_only || list_empty(&inode_list);
> > > -- 
> > > 2.32.0

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

* Re: [f2fs-dev] [PATCH v2] f2fs: avoid attaching SB_ACTIVE flag during mount
@ 2021-09-10 22:06       ` Jaegeuk Kim
  0 siblings, 0 replies; 8+ messages in thread
From: Jaegeuk Kim @ 2021-09-10 22:06 UTC (permalink / raw)
  To: Chao Yu; +Cc: Zhang Yi, Jan Kara, linux-kernel, linux-f2fs-devel

On 09/04, Chao Yu wrote:
> On 2021/9/4 8:17, Jaegeuk Kim wrote:
> > I remember this gave a regression before?
> 
> I have removed changes which bothers checkpoint disabling path, how
> about testing this in dev-test branch for a while?

Let me give it a try.

> 
> BTW, any plan to porting checkpoint disabling testcases from android
> into xfstest suit?

No.

> 
> Thanks,
> 
> > 
> > On 09/01, Chao Yu wrote:
> > > Quoted from [1]
> > > 
> > > "I do remember that I've added this code back then because otherwise
> > > orphan cleanup was losing updates to quota files. But you're right
> > > that now I don't see how that could be happening and it would be nice
> > > if we could get rid of this hack"
> > > 
> > > [1] https://lore.kernel.org/linux-ext4/99cce8ca-e4a0-7301-840f-2ace67c551f3@huawei.com/T/#m04990cfbc4f44592421736b504afcc346b2a7c00
> > > 
> > > Related fix in ext4 by
> > > commit 72ffb49a7b62 ("ext4: do not set SB_ACTIVE in ext4_orphan_cleanup()").
> > > 
> > > f2fs has the same hack implementation in
> > > - f2fs_recover_orphan_inodes()
> > > - f2fs_recover_fsync_data()
> > > 
> > > Let's get rid of this hack as well in f2fs.
> > > 
> > > Cc: Zhang Yi <yi.zhang@huawei.com>
> > > Cc: Jan Kara <jack@suse.cz>
> > > Acked-by: Jan Kara <jack@suse.cz>
> > > Signed-off-by: Chao Yu <chao@kernel.org>
> > > ---
> > > v2:
> > > - don't bother checkpoint disabling path
> > >   fs/f2fs/checkpoint.c | 3 ---
> > >   fs/f2fs/recovery.c   | 8 ++------
> > >   2 files changed, 2 insertions(+), 9 deletions(-)
> > > 
> > > diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c
> > > index 83e9bc0f91ff..7d8803a4cbc2 100644
> > > --- a/fs/f2fs/checkpoint.c
> > > +++ b/fs/f2fs/checkpoint.c
> > > @@ -705,9 +705,6 @@ int f2fs_recover_orphan_inodes(struct f2fs_sb_info *sbi)
> > >   	}
> > >   #ifdef CONFIG_QUOTA
> > > -	/* Needed for iput() to work correctly and not trash data */
> > > -	sbi->sb->s_flags |= SB_ACTIVE;
> > > -
> > >   	/*
> > >   	 * Turn on quotas which were not enabled for read-only mounts if
> > >   	 * filesystem has quota feature, so that they are updated correctly.
> > > diff --git a/fs/f2fs/recovery.c b/fs/f2fs/recovery.c
> > > index 04655511d7f5..706ddb3c95c0 100644
> > > --- a/fs/f2fs/recovery.c
> > > +++ b/fs/f2fs/recovery.c
> > > @@ -787,8 +787,6 @@ int f2fs_recover_fsync_data(struct f2fs_sb_info *sbi, bool check_only)
> > >   	}
> > >   #ifdef CONFIG_QUOTA
> > > -	/* Needed for iput() to work correctly and not trash data */
> > > -	sbi->sb->s_flags |= SB_ACTIVE;
> > >   	/* Turn on quotas so that they are updated correctly */
> > >   	quota_enabled = f2fs_enable_quota_files(sbi, s_flags & SB_RDONLY);
> > >   #endif
> > > @@ -816,10 +814,8 @@ int f2fs_recover_fsync_data(struct f2fs_sb_info *sbi, bool check_only)
> > >   	err = recover_data(sbi, &inode_list, &tmp_inode_list, &dir_list);
> > >   	if (!err)
> > >   		f2fs_bug_on(sbi, !list_empty(&inode_list));
> > > -	else {
> > > -		/* restore s_flags to let iput() trash data */
> > > -		sbi->sb->s_flags = s_flags;
> > > -	}
> > > +	else
> > > +		f2fs_bug_on(sbi, sbi->sb->s_flags & SB_ACTIVE);
> > >   skip:
> > >   	fix_curseg_write_pointer = !check_only || list_empty(&inode_list);
> > > -- 
> > > 2.32.0


_______________________________________________
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] 8+ messages in thread

end of thread, other threads:[~2021-09-10 22:06 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-01  8:06 [PATCH v2] f2fs: avoid attaching SB_ACTIVE flag during mount Chao Yu
2021-09-01  8:06 ` [f2fs-dev] " Chao Yu
2021-09-04  0:17 ` Jaegeuk Kim
2021-09-04  0:17   ` [f2fs-dev] " Jaegeuk Kim
2021-09-04  3:06   ` Chao Yu
2021-09-04  3:06     ` [f2fs-dev] " Chao Yu
2021-09-10 22:06     ` Jaegeuk Kim
2021-09-10 22:06       ` [f2fs-dev] " Jaegeuk Kim

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.