Closed anbe42 closed 4 months ago
@anbe42 Thank you for reporting.
The solution is probably to conditionally append ', IOPRIO_DEFAULT' as last parameter to the dm_io calls.
should be true.
But we must to pay attention to supporting older kernels. It now supports 3.10 or later. There are a lot of version-code switch in the code and it is really bad. I want to sort it out to discontinue the support for really older version.
By the way, the modification to dm_io needs version-code switch as well. Since they are backported to older kernel like 6.1, 6.6, 6.7 and 6.8. Other kernels like 6.2 isn't affected? If so, the switch will be very terrible.
What about replacing all dm_io()
calls with a DM_IO()
macro:
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6,8,2)) || \
((LINUX_VERSION_CODE >= KERNEL_VERSION(6,7,11)) && (LINUX_VERSION_CODE < KERNEL_VERSION(6,8,0))) || \
((LINUX_VERSION_CODE >= KERNEL_VERSION(6,6,23)) && (LINUX_VERSION_CODE < KERNEL_VERSION(6,7,0))) || \
((LINUX_VERSION_CODE >= KERNEL_VERSION(6,1,83)) && (LINUX_VERSION_CODE < KERNEL_VERSION(6,2,0)))
// Linux commit 6e5f0f6383b4896c7e9b943d84b136149d0f45e9 "dm io: Support IO priority"
// introduced the 5th argument.
#define DM_IO(arg1, arg2, arg3, arg4) dm_io(arg1, arg2, arg3, arg4, IOPRIO_DEFAULT)
#else
#define DM_IO(arg1, arg2, arg3, arg4) dm_io(arg1, arg2, arg3, arg4)
#endif
(completely untested)
Thank you. But is this really the best one?
I want a more succinct solution because I hardly think that complicated version-switches are maintainable.
What is the aim of the flag added to dm_io and the reason it is backported to those specific kernel versions?
The corresponding change "dm io: Support IO priority" has been introduced in v6.9-rc1 (6e5f0f6383b4896c7e9b943d84b136149d0f45e9) and has been backported to v6.8.2 (3d02f57794b56f8a04a21fdfb04f20a1c9f712a7) v6.7.11 (4156ddd66b15ca409cd52dc7040c28c25143ce5a) v6.6.23 (5cfcea64883486d79c695afdc502e32eb1b71587) v6.1.83 (92b3c2437df8fe55a5c7816d9521b1fb7d0718b0)
The solution is probably to conditionally append ', IOPRIO_DEFAULT' as last parameter to the dm_io calls.