diff mbox series

bugfix for block_dev_kernel/ltp_block_dev.c

Message ID 20210510095609.20128-1-dongshijiang@inspur.com
State Accepted
Headers show
Series bugfix for block_dev_kernel/ltp_block_dev.c | expand

Commit Message

dongshijiang May 10, 2021, 9:56 a.m. UTC
Add genhd.h and blkdev.h to ltp_block_dev.c.

Failed at compile time on kernel 5.12 due to change of register_blkdev function definition from linux/fs.h to linux/genhd.h and failure of test case tc05,The reason is that the BLKDEV_MAJOR_MAX definition was changed from fs.h to blkdev.h

Signed-off-by: dongshijiang <dongshijiang@inspur.com>
---
 .../device-drivers/block/block_dev_kernel/ltp_block_dev.c       | 2 ++
 1 file changed, 2 insertions(+)

--
2.18.2

Comments

Petr Vorel May 10, 2021, 4:52 p.m. UTC | #1
Hi,

> Add genhd.h and blkdev.h to ltp_block_dev.c.

> Failed at compile time on kernel 5.12 due to change of register_blkdev function definition from linux/fs.h to linux/genhd.h and failure of test case tc05,The reason is that the BLKDEV_MAJOR_MAX definition was changed from fs.h to blkdev.h

Good catch, merged with slightly changed commit message.
Thanks!

Maybe we should not ignore build error for kernel module to catch these API
changes earlier.

Kind regards,
Petr
diff mbox series

Patch

diff --git a/testcases/kernel/device-drivers/block/block_dev_kernel/ltp_block_dev.c b/testcases/kernel/device-drivers/block/block_dev_kernel/ltp_block_dev.c
index c7c8683a2..17047c0d5 100644
--- a/testcases/kernel/device-drivers/block/block_dev_kernel/ltp_block_dev.c
+++ b/testcases/kernel/device-drivers/block/block_dev_kernel/ltp_block_dev.c
@@ -12,6 +12,8 @@ 
 #include <linux/module.h>
 #include <linux/device.h>
 #include <linux/fs.h>
+#include <linux/genhd.h>
+#include <linux/blkdev.h>

 MODULE_AUTHOR("Márton Németh <nm127@freemail.hu>");
 MODULE_AUTHOR("Copyright (c) 2013 Oracle and/or its affiliates");