The first arg of submit_bio is used for block dump #13006
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.
Because some kernel version of submit_bio use the first argument for block dump function. We could use the result of bio_data_dir instead of 0.
Signed-off-by: Finix Yan [email protected]
Motivation and Context
When enable block dump by "echo 1 > /proc/sys/vm/block_dump"
I got "[47410.364655] z_wr_int(17446): READ block 1348575456 on nvme0n1p1 (8 sectors)"
But from iostat it shows this block device only has WRITE operation.
I notice that submit_bio of kernel 3.10 use the first argument "rw" for statistic.
void submit_bio(int rw, struct bio *bio)
{
.......
if (unlikely(block_dump)) {
char b[BDEVNAME_SIZE];
printk(KERN_DEBUG "%s(%d): %s block %Lu on %s (%u sectors)\n",
current->comm, task_pid_nr(current),
(rw & WRITE) ? "WRITE" : "READ",
(unsigned long long)bio->bi_sector,
bdevname(bio->bi_bdev, b),
count);
}
}
The output of block dump always reports READ instead of WRITE because rw is passed 0.
Description
How Has This Been Tested?
Types of changes
Checklist:
Signed-off-by
.