Skip to content
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

partition: wait for 1s between mkpart and mklabel #3562

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

hs0210
Copy link
Contributor

@hs0210 hs0210 commented Nov 11, 2022

Sometimes it will fail to mkpart just after mklabel, it says that: "Partition(s) 1 on /dev/sda have been written, but we have been unable to inform the kernel of the change, probably because it/they are in use. As a result, the old partition(s) will remain in use. You should reboot now before making further changes."

Wait a little time can fix this problem.

Before:

# /usr/local/bin/avocado run --vt-type libvirt --test-runner=runner --vt-machine-type arm64-mmio svirt_attach_disk.positive_test.disk_pool.disk_seclabel.enable_namespace.disk_label_svirt_image_s0.sec_relabel_yes.sec_type_static --vt-connect-uri qemu:///system
JOB ID     : 9947bb62fcbb04b53c5ec9d770cf8b46716ea2d0
JOB LOG    : /root/avocado/job-results/job-2022-11-11T05.09-9947bb6/job.log
 (1/1) type_specific.io-github-autotest-libvirt.svirt_attach_disk.positive_test.disk_pool.disk_seclabel.enable_namespace.disk_label_svirt_image_s0.sec_relabel_yes.sec_type_static: 
ERROR: Command 'parted -s -a optimal /dev/sdb mkpart primary ext4 0 20.0' failed.\nstdout: b''\nstderr: b'Warning: The resulting partition is not properly aligned for best performance: 1s % 16384s != 0s\n
Error: Partition(s) 1 on /dev/sdb have been written, but we have been unable to inform the kernel of the change, probably because it/they are in use.  As a result, the old partition(s) will remain in use.  You should reboot now before making further changes.\n (18.80 s)
RESULTS    : PASS 0 | ERROR 1 | FAIL 0 | SKIP 0 | WARN 0 | INTERRUPT 0 | CANCEL 0
JOB HTML   : /root/avocado/job-results/job-2022-11-11T05.09-9947bb6/results.html
JOB TIME   : 19.15 s

After:

# /usr/local/bin/avocado run --vt-type libvirt --test-runner=runner --vt-machine-type arm64-mmio svirt_attach_disk.positive_test.disk_pool.disk_seclabel.enable_namespace.disk_label_svirt_image_s0.sec_relabel_yes.sec_type_static --vt-connect-uri qemu:///system
JOB ID     : b41b9272fc60d969b91e1d1d1b7e7a33386707f5
JOB LOG    : /root/avocado/job-results/job-2022-11-11T05.13-b41b927/job.log
 (1/1) type_specific.io-github-autotest-libvirt.svirt_attach_disk.positive_test.disk_pool.disk_seclabel.enable_namespace.disk_label_svirt_image_s0.sec_relabel_yes.sec_type_static: PASS (47.24 s)
RESULTS    : PASS 1 | ERROR 0 | FAIL 0 | SKIP 0 | WARN 0 | INTERRUPT 0 | CANCEL 0
JOB HTML   : /root/avocado/job-results/job-2022-11-11T05.13-b41b927/results.html
JOB TIME   : 47.60 s

Signed-off-by: Hu Shuai [email protected]

@hs0210 hs0210 changed the title prepare_pool: wait for 1s before mkpart after mklabel prepare_pool: wait for 1s between mkpart and mklabel Nov 24, 2022
@hs0210 hs0210 changed the title prepare_pool: wait for 1s between mkpart and mklabel svirt: wait for 1s between mkpart and mklabel Feb 22, 2023
@hs0210 hs0210 changed the title svirt: wait for 1s between mkpart and mklabel partition: wait for 1s between mkpart and mklabel Jul 10, 2023
@hs0210
Copy link
Contributor Author

hs0210 commented Jul 10, 2023

This problem sometimes occurs in aarch64 CI tests, but not when I test manually.
Sleeping for 1 second in CI tests also fixes the issue.

@hs0210 hs0210 marked this pull request as draft July 10, 2023 10:06
Sometimes it will fail to mkpart just after mklabel, it says that:
"Partition(s) 1 on /dev/sda have been written, but we have been unable to inform the kernel of the change,
probably because it/they are in use. As a result, the old partition(s) will remain in use.
You should reboot now before making further changes."

Wait a little time can fix this problem.

Signed-off-by: Hu Shuai <[email protected]>
@hs0210 hs0210 marked this pull request as ready for review July 11, 2023 01:40
Copy link
Contributor

@chunfuwen chunfuwen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants