linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] f2fs: warn on when fsck flag is set
@ 2021-08-11 13:30 Yangtao Li
  2021-08-11 13:40 ` Chao Yu
  0 siblings, 1 reply; 2+ messages in thread
From: Yangtao Li @ 2021-08-11 13:30 UTC (permalink / raw)
  To: jaegeuk, chao; +Cc: linux-f2fs-devel, linux-kernel, Yangtao Li

SBI_NEED_FSCK is an indicator that fsck.f2fs needs to be triggered,
this flag is set in too many places. For some scenes that are not very reproducible,
adding stack information will help locate the problem.

Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
v2:
-convert to WARN_ON
-one more blank
 fs/f2fs/f2fs.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
index 67faa43cc141..2e2294234c0d 100644
--- a/fs/f2fs/f2fs.h
+++ b/fs/f2fs/f2fs.h
@@ -33,7 +33,7 @@
 #else
 #define f2fs_bug_on(sbi, condition)					\
 	do {								\
-		if (WARN_ON(condition))					\
+		if ((condition))					\
 			set_sbi_flag(sbi, SBI_NEED_FSCK);		\
 	} while (0)
 #endif
@@ -1999,6 +1999,8 @@ static inline bool is_sbi_flag_set(struct f2fs_sb_info *sbi, unsigned int type)
 
 static inline void set_sbi_flag(struct f2fs_sb_info *sbi, unsigned int type)
 {
+	WARN_ON(type ==  SBI_NEED_FSCK);
+
 	set_bit(type, &sbi->s_flag);
 }
 
-- 
2.32.0


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

* Re: [PATCH v2] f2fs: warn on when fsck flag is set
  2021-08-11 13:30 [PATCH v2] f2fs: warn on when fsck flag is set Yangtao Li
@ 2021-08-11 13:40 ` Chao Yu
  0 siblings, 0 replies; 2+ messages in thread
From: Chao Yu @ 2021-08-11 13:40 UTC (permalink / raw)
  To: Yangtao Li, jaegeuk; +Cc: linux-f2fs-devel, linux-kernel

On 2021/8/11 21:30, Yangtao Li wrote:
> SBI_NEED_FSCK is an indicator that fsck.f2fs needs to be triggered,
> this flag is set in too many places. For some scenes that are not very reproducible,
> adding stack information will help locate the problem.
> 
> Signed-off-by: Yangtao Li <frank.li@vivo.com>
> ---
> v2:
> -convert to WARN_ON
> -one more blank
>   fs/f2fs/f2fs.h | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
> index 67faa43cc141..2e2294234c0d 100644
> --- a/fs/f2fs/f2fs.h
> +++ b/fs/f2fs/f2fs.h
> @@ -33,7 +33,7 @@
>   #else
>   #define f2fs_bug_on(sbi, condition)					\
>   	do {								\
> -		if (WARN_ON(condition))					\
> +		if ((condition))					\

Why removing WARN_ON()?

>   			set_sbi_flag(sbi, SBI_NEED_FSCK);		\
>   	} while (0)
>   #endif
> @@ -1999,6 +1999,8 @@ static inline bool is_sbi_flag_set(struct f2fs_sb_info *sbi, unsigned int type)
>   
>   static inline void set_sbi_flag(struct f2fs_sb_info *sbi, unsigned int type)
>   {
> +	WARN_ON(type ==  SBI_NEED_FSCK);

Again, please remove one unnecessary blank character before SBI_NEED_FSCK.

WARN_ON_ONCE(type == SBI_NEED_FSCK)

> +

No need to add blank line.

Thanks,

>   	set_bit(type, &sbi->s_flag);
>   }
>   
> 

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

end of thread, other threads:[~2021-08-11 13:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-11 13:30 [PATCH v2] f2fs: warn on when fsck flag is set Yangtao Li
2021-08-11 13:40 ` Chao Yu

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).