Skip to content

Commit 6007a4f

Browse files
committed
fix get device from request
Signed-off-by: YangKeao <[email protected]>
1 parent 26adc73 commit 6007a4f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

driver/ioem.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ struct request;
2626
#define rb_to_rq(rb) rb_entry_safe(rb, struct request, rb_node)
2727
#define rq_rb_first(root) rb_to_rq(rb_first(root))
2828

29-
#define IS_RHEL
3029
#define IOEM_MQ_ENABLED ((LINUX_VERSION_CODE >= KERNEL_VERSION(4, 0, 0)) || (defined RHEL_MAJOR && RHEL_MAJOR >= 7 && defined RHEL_MINOR && RHEL_MINOR >= 6))
3130

3231
/**
@@ -835,9 +834,15 @@ static bool ioem_should_inject(struct ioem_data* id, struct request* rq, struct
835834
return 0;
836835
}
837836

837+
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 0, 0)
838838
if (e->arg.device != 0 && e->arg.device != id->device) {
839839
return 0;
840840
}
841+
#else
842+
if (e->arg.device != 0 && e->arg.device != disk_devt(rq->rq_disk)) {
843+
return 0;
844+
}
845+
#endif
841846

842847
if (e->arg.op)
843848
{

0 commit comments

Comments
 (0)