-
Notifications
You must be signed in to change notification settings - Fork 996
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
lib: tst_device: sleep before unbinding the loop device #866
base: master
Are you sure you want to change the base?
Conversation
When running ltp/ltpstress test that kernel will generats io error of loop device, which was due to loop io request doesn't finished dispatch before unbinding the loop device. and this patch fixed io error issue by add the logic that sleep for a shor period before unbinding the loop device. Signed-off-by: Yinbo Zhu <zhuyinbo@loongson.cn>
What exact error did you get? You should handle the error correctly rather than moving sleep() around and hoping that you will not hit it. |
Hi metan-ucw, That ltpstress io error is "print_req_error: I/O error, dev loop0, sector 0" , which was due to loop io request doesn't finished |
The "print_req_error: I/O error, dev loop0, sector 0" is a kernel error, right? What is the output from the testcases? There should be some kind of error in there as well. |
After a bit of debugging over IRC we found that the problem seems to be in the fallback with a loop device for the needs_rofs flag. It seems that some tests fails to clean up properly when the test is skipped early such as chown04_16. |
Hi metan-ucw, Yes, the "print_req_error: I/O error, dev loop0, sector 0" is a kernel error. In the previous description, I have analyzed the conditions for this loop error. the corresponding code is as follows: The following code is the logic of loop IO error happen, the function "blk_mq_dispatch_rq_list" responsible for io dispatch, the "q->mq_ops->queue_rq" is initialized with "loop_queue_rq" , the function "blk_mq_end_request" will call "print_req_error(req, error), then kernel will report "print_req_error: I/O error, dev loop0, sector 0"
... According to a large number of ltpstress test results, almost all test cases that use loop devices and have IO operations on loop devices will encounter this problem. Among them, the open12 testcase has the highest probability of hitting IO errors, and other recorded testcases that report errors are rename11 、lchown03、mmap16 、utime06、mknod07、ftruncate04. |
When running ltp/ltpstress test that kernel will generats io error
of loop device, which was due to loop io request doesn't finished
dispatch before unbinding the loop device. and this patch fixed io
error issue by add the logic that sleep for a shor period before
unbinding the loop device.
Signed-off-by: Yinbo Zhu zhuyinbo@loongson.cn