public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH] block/ltp_block_dev.c: Fix error on older distributions
@ 2019-03-11  3:21 Jinhui huang
  2019-03-11  3:27 ` Xiao Yang
  0 siblings, 1 reply; 3+ messages in thread
From: Jinhui huang @ 2019-03-11  3:21 UTC (permalink / raw)
  To: ltp

major number was limited to 511(i.e. BLKDEV_MAJOR_MAX - 1) by commit 133d55c
since kernel v4.14 so that register_blkdev() with a major number gather than
511 got failure on older distributions.  It's just a change of limit rather
than bug fix so we want to accept both of results on all kernels.

Fixes: 8d19ee6 ("block/ltp_block_dev.c: Update tests for the newer kernel")

Signed-off-by: Jinhui huang <huangjh.jy@cn.fujitsu.com>
---
 .../kernel/device-drivers/block/block_dev_kernel/ltp_block_dev.c     | 5 +++++
 1 file changed, 5 insertions(+)

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 b0f6ce5..c7c8683 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
@@ -232,10 +232,15 @@ static int tc05(void)
 
 		if (major == 0) {
 			unregister_blkdev(test_major[i], BLK_DEV_NAME);
+#ifdef BLKDEV_MAJOR_MAX
 			pass = 0;
+#endif
 		} else {
 			prk_debug("register_blkdev() with major %u got error %i\n",
 				  test_major[i], major);
+#ifndef BLKDEV_MAJOR_MAX
+			pass = 0;
+#endif
 		}
 	}
 
-- 
1.8.3.1




^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-03-14 10:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-03-11  3:21 [LTP] [PATCH] block/ltp_block_dev.c: Fix error on older distributions Jinhui huang
2019-03-11  3:27 ` Xiao Yang
2019-03-14 10:12   ` Xiao Yang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox