From: Keith Busch <kbusch@kernel.org>
To: alan.adamson@oracle.com
Cc: Christoph Hellwig <hch@lst.de>,
linux-nvme@lists.infradead.org, sagi@grimberg.me,
linux-block@vger.kernel.org
Subject: Re: [RFC 0/1] nvme: Add NVMe LBA Fault Injection
Date: Thu, 18 Jan 2024 21:48:03 -0700 [thread overview]
Message-ID: <Zan_A-dR5ReYTfBF@kbusch-mbp.dhcp.thefacebook.com> (raw)
In-Reply-To: <6874a81c-3f4f-428a-8a95-19898ca004a2@oracle.com>
On Thu, Jan 18, 2024 at 09:02:43AM -0800, alan.adamson@oracle.com wrote:
>
> On 1/17/24 11:24 PM, Christoph Hellwig wrote:
> > On Tue, Jan 16, 2024 at 03:27:27PM -0800, Alan Adamson wrote:
> > > It has been requested that the NVMe fault injector be able to inject faults when accessing
> > > specific Logical Block Addresses (LBA).
> > Curious, but who has requested this? Because injecting errors really
> > isn't the drivers job.
>
>
> It's an application (database) that is requesting it for their error
> handling testing.
Going out on a limb here... This seems so obscure to burden a driver to
synthesize. Could we just give a hook for a bpf override and you can
totally go for whatever scenario you can imagine with a script?
---
diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index 50818dbcfa1ae..df87a63335aa8 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -381,9 +381,22 @@ static inline void nvme_end_req_zoned(struct request *req)
}
}
+#ifdef CONFIG_BPF_KPROBE_OVERRIDE
+static noinline blk_status_t nvme_req_status(struct nvme_request *req)
+{
+ return nvme_error_status(req->status);
+}
+ALLOW_ERROR_INJECTION(nvme_req_status, ERRNO);
+#else
+static inline blk_status_t nvme_req_status(struct nvme_request *req)
+{
+ return nvme_error_status(req->status);
+}
+#endif
+
static inline void nvme_end_req(struct request *req)
{
- blk_status_t status = nvme_error_status(nvme_req(req)->status);
+ blk_status_t status = nvme_req_status(nvme_req(req));
if (unlikely(nvme_req(req)->status && !(req->rq_flags & RQF_QUIET)))
nvme_log_error(req);
--
next prev parent reply other threads:[~2024-01-19 4:48 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20240116232728.3392996-1-alan.adamson@oracle.com>
2024-01-18 7:24 ` [RFC 0/1] nvme: Add NVMe LBA Fault Injection Christoph Hellwig
2024-01-18 17:02 ` alan.adamson
2024-01-19 4:48 ` Keith Busch [this message]
2024-01-23 9:05 ` Christoph Hellwig
2024-01-23 17:25 ` alan.adamson
2024-01-24 9:04 ` Christoph Hellwig
2024-01-24 16:52 ` alan.adamson
2024-01-24 16:59 ` Keith Busch
2024-01-24 17:11 ` alan.adamson
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=Zan_A-dR5ReYTfBF@kbusch-mbp.dhcp.thefacebook.com \
--to=kbusch@kernel.org \
--cc=alan.adamson@oracle.com \
--cc=hch@lst.de \
--cc=linux-block@vger.kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=sagi@grimberg.me \
/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