From: Yangtao Li <frank.li@vivo.com>
To: Jaegeuk Kim <jaegeuk@kernel.org>, Chao Yu <chao@kernel.org>
Cc: Yangtao Li <frank.li@vivo.com>,
linux-f2fs-devel@lists.sourceforge.net,
linux-kernel@vger.kernel.org
Subject: [PATCH] f2fs: call fsnotify_sb_error() when f2fs have errors
Date: Mon, 19 Jun 2023 16:20:25 +0800 [thread overview]
Message-ID: <20230619082025.10832-1-frank.li@vivo.com> (raw)
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 | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index 375a178540d6..69c747c4d4f4 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"
@@ -4035,6 +4036,8 @@ static void f2fs_record_stop_reason(struct f2fs_sb_info *sbi)
f2fs_up_write(&sbi->sb_lock);
if (err)
f2fs_err(sbi, "f2fs_commit_super fails to record err:%d", err);
+
+ fsnotify_sb_error(sbi->sb, NULL, EFSCORRUPTED);
}
void f2fs_save_errors(struct f2fs_sb_info *sbi, unsigned char flag)
@@ -4081,6 +4084,8 @@ static void f2fs_record_errors(struct f2fs_sb_info *sbi, unsigned char error)
error, err);
out_unlock:
f2fs_up_write(&sbi->sb_lock);
+
+ fsnotify_sb_error(sbi->sb, NULL, EFSCORRUPTED);
}
void f2fs_handle_error(struct f2fs_sb_info *sbi, unsigned char error)
--
2.39.0
reply other threads:[~2023-06-19 8:21 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20230619082025.10832-1-frank.li@vivo.com \
--to=frank.li@vivo.com \
--cc=chao@kernel.org \
--cc=jaegeuk@kernel.org \
--cc=linux-f2fs-devel@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
/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
all inboxes | Powered by JetHome®