Jarod.w has uploaded a new change for review.
Change subject: vdsm: free loop device when umounting floppy in mkimage.py ......................................................................
vdsm: free loop device when umounting floppy in mkimage.py
After umounting floppy successfully, it doesn't free automatically the loop device. Here, we add the support to free the loop device in the umount function of Mount class and free it to prevent it using up all loop devices.
The issue only happened in the special case that node is built using livecd-tools(version: 16.8-1) and rpms from centos63. Because: 1. Centos63 disables auto-destruction feature and still depends on /etc/mtab to free the loop device. 2. Livecd-tools links /etc/mtab to /proc/self/mounts, so umount can't get suggestion to free the loop device from /etc/mtab.
Change-Id: Ia02cfaf4d8ba46de6d42b12d15351d3ab1cb3d03 Signed-off-by: jarod.w work.iec23801@gmail.com --- M vdsm/mkimage.py M vdsm/storage/mount.py 2 files changed, 5 insertions(+), 2 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/32/11132/1
diff --git a/vdsm/mkimage.py b/vdsm/mkimage.py index c3c66ab..0eabae2 100644 --- a/vdsm/mkimage.py +++ b/vdsm/mkimage.py @@ -90,7 +90,7 @@ try: _decodeFilesIntoDir(files, dirname) finally: - m.umount(force=True) + m.umount(force=True, freeloop=True) finally: _commonCleanFs(dirname, floppy)
diff --git a/vdsm/storage/mount.py b/vdsm/storage/mount.py index 81ca17f..90cacc7 100644 --- a/vdsm/storage/mount.py +++ b/vdsm/storage/mount.py @@ -237,7 +237,7 @@
raise MountError(rc, ";".join((out, err)))
- def umount(self, force=False, lazy=False, timeout=None): + def umount(self, force=False, lazy=False, freeloop=False, timeout=None): cmd = [constants.EXT_UMOUNT] if force: cmd.append("-f") @@ -245,6 +245,9 @@ if lazy: cmd.append("-l")
+ if freeloop: + cmd.append("-d") + cmd.append(self.fs_file)
return self._runcmd(cmd, timeout)
-- To view, visit http://gerrit.ovirt.org/11132 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange Gerrit-Change-Id: Ia02cfaf4d8ba46de6d42b12d15351d3ab1cb3d03 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Jarod.w work.iec23801@gmail.com
oVirt Jenkins CI Server has posted comments on this change.
Change subject: vdsm: free loop device when umounting floppy in mkimage.py ......................................................................
Patch Set 1:
Build Started http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/763/ (2/2)
-- To view, visit http://gerrit.ovirt.org/11132 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: Ia02cfaf4d8ba46de6d42b12d15351d3ab1cb3d03 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Jarod.w work.iec23801@gmail.com Gerrit-Reviewer: oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.
Change subject: vdsm: free loop device when umounting floppy in mkimage.py ......................................................................
Patch Set 1:
Build Started http://jenkins.ovirt.org/job/vdsm_unit_tests_manual_gerrit/798/ (1/2)
-- To view, visit http://gerrit.ovirt.org/11132 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: Ia02cfaf4d8ba46de6d42b12d15351d3ab1cb3d03 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Jarod.w work.iec23801@gmail.com Gerrit-Reviewer: oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.
Change subject: vdsm: free loop device when umounting floppy in mkimage.py ......................................................................
Patch Set 1:
Build Successful
http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/763/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_unit_tests_manual_gerrit/798/ : SUCCESS
-- To view, visit http://gerrit.ovirt.org/11132 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: Ia02cfaf4d8ba46de6d42b12d15351d3ab1cb3d03 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Jarod.w work.iec23801@gmail.com Gerrit-Reviewer: oVirt Jenkins CI Server
Jarod.w has posted comments on this change.
Change subject: vdsm: free loop device when umounting floppy in mkimage.py ......................................................................
Patch Set 1: Verified
Verified on centos 6.3 and livecd using 16.8-1
-- To view, visit http://gerrit.ovirt.org/11132 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: Ia02cfaf4d8ba46de6d42b12d15351d3ab1cb3d03 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Jarod.w work.iec23801@gmail.com Gerrit-Reviewer: Jarod.w work.iec23801@gmail.com Gerrit-Reviewer: oVirt Jenkins CI Server
Dan Kenigsberg has posted comments on this change.
Change subject: vdsm: free loop device when umounting floppy in mkimage.py ......................................................................
Patch Set 1: Looks good to me, but someone else must approve
It felt like we already have seen this - you could have mentioned http://gerrit.ovirt.org/8770 !
It seems appropriate here as it was there.
-- To view, visit http://gerrit.ovirt.org/11132 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: Ia02cfaf4d8ba46de6d42b12d15351d3ab1cb3d03 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Jarod.w work.iec23801@gmail.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Jarod.w work.iec23801@gmail.com Gerrit-Reviewer: oVirt Jenkins CI Server
Jarod.w has posted comments on this change.
Change subject: vdsm: free loop device when umounting floppy in mkimage.py ......................................................................
Patch Set 1: No score
Yes, it was. Sorry, it's my fault we missed it on http://gerrit.ovirt.org/8770.
-- To view, visit http://gerrit.ovirt.org/11132 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: Ia02cfaf4d8ba46de6d42b12d15351d3ab1cb3d03 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Jarod.w work.iec23801@gmail.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Hunt Xu mhuntxu@gmail.com Gerrit-Reviewer: Jarod.w work.iec23801@gmail.com Gerrit-Reviewer: Vinzenz Feenstra vfeenstr@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
Hunt Xu has posted comments on this change.
Change subject: vdsm: free loop device when umounting floppy in mkimage.py ......................................................................
Patch Set 1: Looks good to me, but someone else must approve
-- To view, visit http://gerrit.ovirt.org/11132 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: Ia02cfaf4d8ba46de6d42b12d15351d3ab1cb3d03 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Jarod.w work.iec23801@gmail.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Hunt Xu mhuntxu@gmail.com Gerrit-Reviewer: Jarod.w work.iec23801@gmail.com Gerrit-Reviewer: Vinzenz Feenstra vfeenstr@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
Dan Kenigsberg has posted comments on this change.
Change subject: vdsm: free loop device when umounting floppy in mkimage.py ......................................................................
Patch Set 1: Verified; Looks good to me, approved
copy Jarod's verification.
-- To view, visit http://gerrit.ovirt.org/11132 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: Ia02cfaf4d8ba46de6d42b12d15351d3ab1cb3d03 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Jarod.w work.iec23801@gmail.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Hunt Xu mhuntxu@gmail.com Gerrit-Reviewer: Jarod.w work.iec23801@gmail.com Gerrit-Reviewer: Vinzenz Feenstra vfeenstr@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
Dan Kenigsberg has submitted this change and it was merged.
Change subject: vdsm: free loop device when umounting floppy in mkimage.py ......................................................................
vdsm: free loop device when umounting floppy in mkimage.py
After umounting floppy successfully, it doesn't free automatically the loop device. Here, we add the support to free the loop device in the umount function of Mount class and free it to prevent it using up all loop devices.
The issue only happened in the special case that node is built using livecd-tools(version: 16.8-1) and rpms from centos63. Because: 1. Centos63 disables auto-destruction feature and still depends on /etc/mtab to free the loop device. 2. Livecd-tools links /etc/mtab to /proc/self/mounts, so umount can't get suggestion to free the loop device from /etc/mtab.
Change-Id: Ia02cfaf4d8ba46de6d42b12d15351d3ab1cb3d03 Signed-off-by: jarod.w work.iec23801@gmail.com --- M vdsm/mkimage.py M vdsm/storage/mount.py 2 files changed, 5 insertions(+), 2 deletions(-)
Approvals: Hunt Xu: Looks good to me, but someone else must approve Dan Kenigsberg: Verified; Looks good to me, approved
-- To view, visit http://gerrit.ovirt.org/11132 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: merged Gerrit-Change-Id: Ia02cfaf4d8ba46de6d42b12d15351d3ab1cb3d03 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Jarod.w work.iec23801@gmail.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Hunt Xu mhuntxu@gmail.com Gerrit-Reviewer: Jarod.w work.iec23801@gmail.com Gerrit-Reviewer: Vinzenz Feenstra vfeenstr@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
vdsm-patches@lists.fedorahosted.org