tools/mdflush: Fix CI build failure #3936
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
CI failed due to the following error (in mdflush.py, bio->bi_disk not found). I guess CI runtime env (such as kernel version) had changed in recent days.
Before kernel 4.14, stay the same, just use bio->bi_bdev->bd_disk.
Since kernel 4.14, macro bio_dev begin to appear, which refers to bio->bi_disk.
Since kernel 5.12, macro bio_dev has changed to bio->bi_bdev->bd_disk (bio->bi_bdev changed back). So, just use '#ifdef bio_dev' could not make the right choice under higher kernel version.
This patch try to fix this error. Please take a look. @davemarchevsky @yonghong-song