From: Yangtao Li <frank.li@vivo.com>
To: jaegeuk@kernel.org, chao@kernel.org
Cc: linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] f2fs: merge f2fs_show_injection_info() into time_to_inject()
Date: Fri, 16 Dec 2022 11:48:11 +0800 [thread overview]
Message-ID: <20221216034811.4603-1-frank.li@vivo.com> (raw)
In-Reply-To: <dedae282-2d13-cc12-95b8-98cfd377d98c@kernel.org>
> After moving f2fs_show_injection_info() core functionality into time_to_inject(),
> __builtin_return_address(0) result changes from return address of caller of
> f2fs_show_injection_info() to return address of time_to_inject().
I tried the __builtin_return_address(1) parameter just now, and no error
was reported when compiling, but a null pointer problem will be triggered
when the kernel is running.
I thought about it, and the print address didn't seem clear enough.
Let's just print the line number of the caller?
#define time_to_inject(sbi, type) __time_to_inject(sbi, type, __func__, __LINE__)
static inline bool __time_to_inject(struct f2fs_sb_info *sbi, int type,
const char *func_name, unsigned int line)
{
struct f2fs_fault_info *ffi = &F2FS_OPTION(sbi).fault_info;
if (!ffi->inject_rate)
return false;
if (!IS_FAULT_SET(ffi, type))
return false;
atomic_inc(&ffi->inject_ops);
if (atomic_read(&ffi->inject_ops) >= ffi->inject_rate) {
atomic_set(&ffi->inject_ops, 0);
printk_ratelimited("%sF2FS-fs (%s) : inject %s in [%s] %d\n",
KERN_INFO, sbi->sb->s_id, f2fs_fault_name[type],
func_name, line);
return true;
}
return false;
}
Thx,
Yangtao
next prev parent reply other threads:[~2022-12-16 3:48 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-15 12:20 Yangtao Li
2022-12-16 2:51 ` Chao Yu
2022-12-16 3:48 ` Yangtao Li [this message]
2022-12-16 10:47 ` Chao Yu
2022-12-16 19:32 ` Yangtao Li
2022-12-17 1:14 ` Chao Yu
2022-12-17 4:51 ` Yangtao Li
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=20221216034811.4603-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®