linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
* [f2fs-dev] [PATCH] f2fs: add fsnotify_sb_error() in f2fs_save_errors
@ 2023-05-11  9:13 Yangtao Li via Linux-f2fs-devel
  2023-05-17  2:31 ` Chao Yu
  0 siblings, 1 reply; 2+ messages in thread
From: Yangtao Li via Linux-f2fs-devel @ 2023-05-11  9:13 UTC (permalink / raw)
  To: Jaegeuk Kim, Chao Yu; +Cc: linux-f2fs-devel, linux-kernel, Yangtao Li

When an EFSCORRUPTED error occurs in f2fs, report the error to
userspace monitoring tools.

Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
 fs/f2fs/super.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index 51812f459581..42d5aa504afe 100644
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -28,6 +28,7 @@
 #include <linux/part_stat.h>
 #include <linux/zstd.h>
 #include <linux/lz4.h>
+#include <linux/fsnotify.h>
 
 #include "f2fs.h"
 #include "node.h"
@@ -4000,6 +4001,8 @@ void f2fs_save_errors(struct f2fs_sb_info *sbi, unsigned char flag)
 		sbi->error_dirty = true;
 	}
 	spin_unlock_irqrestore(&sbi->error_lock, flags);
+
+	fsnotify_sb_error(sbi->sb, NULL, EFSCORRUPTED);
 }
 
 static bool f2fs_update_errors(struct f2fs_sb_info *sbi)
-- 
2.39.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] 2+ messages in thread

* Re: [f2fs-dev] [PATCH] f2fs: add fsnotify_sb_error() in f2fs_save_errors
  2023-05-11  9:13 [f2fs-dev] [PATCH] f2fs: add fsnotify_sb_error() in f2fs_save_errors Yangtao Li via Linux-f2fs-devel
@ 2023-05-17  2:31 ` Chao Yu
  0 siblings, 0 replies; 2+ messages in thread
From: Chao Yu @ 2023-05-17  2:31 UTC (permalink / raw)
  To: Yangtao Li, Jaegeuk Kim; +Cc: linux-kernel, linux-f2fs-devel

On 2023/5/11 17:13, Yangtao Li wrote:
> When an EFSCORRUPTED error occurs in f2fs, report the error to
> userspace monitoring tools.
> 
> Signed-off-by: Yangtao Li <frank.li@vivo.com>
> ---
>   fs/f2fs/super.c | 3 +++
>   1 file changed, 3 insertions(+)
> 
> diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
> index 51812f459581..42d5aa504afe 100644
> --- a/fs/f2fs/super.c
> +++ b/fs/f2fs/super.c
> @@ -28,6 +28,7 @@
>   #include <linux/part_stat.h>
>   #include <linux/zstd.h>
>   #include <linux/lz4.h>
> +#include <linux/fsnotify.h>
>   
>   #include "f2fs.h"
>   #include "node.h"
> @@ -4000,6 +4001,8 @@ void f2fs_save_errors(struct f2fs_sb_info *sbi, unsigned char flag)
>   		sbi->error_dirty = true;
>   	}
>   	spin_unlock_irqrestore(&sbi->error_lock, flags);
> +
> +	fsnotify_sb_error(sbi->sb, NULL, EFSCORRUPTED);

Can we call this function in irq context?

- f2fs_decompress_cluster
  - f2fs_save_errors

Thanks,

>   }
>   
>   static bool f2fs_update_errors(struct f2fs_sb_info *sbi)


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

end of thread, other threads:[~2023-05-17  2:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-11  9:13 [f2fs-dev] [PATCH] f2fs: add fsnotify_sb_error() in f2fs_save_errors Yangtao Li via Linux-f2fs-devel
2023-05-17  2:31 ` 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).