Lines Matching +full:fault +full:- +full:q
1 // SPDX-License-Identifier: GPL-2.0
3 * fault injection support for nvme.
13 /* optional fault injection attributes boot time option:
23 struct fault_attr *attr = &fault_inj->attr; in nvme_fault_inject_init()
25 /* set default fault injection attribute */ in nvme_fault_inject_init()
43 fault_inj->parent = parent; in nvme_fault_inject_init()
46 fault_inj->status = NVME_SC_INVALID_OPCODE; in nvme_fault_inject_init()
47 fault_inj->dont_retry = true; in nvme_fault_inject_init()
48 debugfs_create_x16("status", 0600, dir, &fault_inj->status); in nvme_fault_inject_init()
49 debugfs_create_bool("dont_retry", 0600, dir, &fault_inj->dont_retry); in nvme_fault_inject_init()
55 debugfs_remove_recursive(fault_inject->parent); in nvme_fault_inject_fini()
60 struct gendisk *disk = req->q->disk; in nvme_should_fail()
65 struct nvme_ns *ns = disk->private_data; in nvme_should_fail()
68 fault_inject = &ns->fault_inject; in nvme_should_fail()
72 fault_inject = &nvme_req(req)->ctrl->fault_inject; in nvme_should_fail()
75 if (fault_inject && should_fail(&fault_inject->attr, 1)) { in nvme_should_fail()
77 status = fault_inject->status; in nvme_should_fail()
78 if (fault_inject->dont_retry) in nvme_should_fail()
80 nvme_req(req)->status = status; in nvme_should_fail()