RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1584079 - udisks2 loop-delete doesn't work for the loop device when the image deleted
Summary: udisks2 loop-delete doesn't work for the loop device when the image deleted
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: udisks2
Version: 7.5
Hardware: x86_64
OS: Linux
unspecified
high
Target Milestone: rc
: ---
Assignee: Vojtech Trefny
QA Contact: guazhang@redhat.com
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-05-30 08:47 UTC by xhe@redhat.com
Modified: 2021-09-06 12:34 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-02-15 07:39:09 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description xhe@redhat.com 2018-05-30 08:47:02 UTC
Description of problem:
udisks2 loop-delete doesn't work for the loop device when the image deleted

Version-Release number of selected component (if applicable):
udisks2-2.7.3-6.el7.x86_64
udisks2-lvm2-2.7.3-6.el7.x86_64
libudisks2-2.7.3-6.el7.x86_64
RHEL-7.5 RC

How reproducible:
100%

Steps to Reproduce:
1. create and setup loop device with udisksctl
  # udisksctl loop-setup -f /tmp/tfile_loop0
2. delete the image file of /tmp/tfile_loop0
  # rm -rf /tmp/tfile_loop0
3. check the status of loop device
  # losetup -l
  NAME       SIZELIMIT OFFSET AUTOCLEAR RO BACK-FILE
  /dev/loop0         0      0         1  0 /tmp/tfile_loop0 (deleted)
4. udisksctl delete the loop device
  # udisksctl loop-delete --block-device /dev/loop0 ---> no output
5. check the loop device status
  # losetup -l 
  NAME       SIZELIMIT OFFSET AUTOCLEAR RO BACK-FILE
  /dev/loop0         0      0         1  0 /tmp/tfile_loop0 (deleted)

# udisksctl unmount --block-device /dev/loop0
Object /org/freedesktop/UDisks2/block_devices/loop0 is not a mountable filesystem.

Actual results:
* udisksctl doesn't work for device without image, moreover there is no output for the not work.
  # udisksctl loop-delete --block-device /dev/loop0 ---> no output
  # losetup -l 
  NAME       SIZELIMIT OFFSET AUTOCLEAR RO BACK-FILE
  /dev/loop0         0      0         1  0 /tmp/tfile_loop0 (deleted)

Expected results:
* udisksctl works for the device without image or udisksctl can print some information and warning i.e "It is an invalid loop device, suggest to remove it with command ...."


Additional info:

Comment 2 Vojtech Trefny 2018-06-11 09:28:47 UTC
Tested with clean install latest RHEL 7.6 compose (RHEL-7.6-20180607.n.0-Server-x86_64) and I can't reproduce this issue:

$ sudo dd if=/dev/zero of=~/file.img bs=1MiB count=10
10+0 records in
10+0 records out
10485760 bytes (10 MB) copied, 0.00984342 s, 1.1 GB/s

$ sudo udisksctl loop-setup -f ~/file.img 
Mapped file /home/vtrefny/file.img as /dev/loop0.

$ sudo rm file.img 

$ sudo losetup -l
NAME       SIZELIMIT OFFSET AUTOCLEAR RO BACK-FILE
/dev/loop0         0      0         0  0 /home/vtrefny/file.img (deleted)

$ sudo udisksctl loop-delete --block-device /dev/loop0

$ sudo losetup -l
(no output)

Comment 3 xhe@redhat.com 2018-06-11 10:45:13 UTC
Thanks Vojtech,
Let me test it again, let you know my result later.

Comment 6 RHEL Program Management 2021-02-15 07:39:09 UTC
After evaluating this issue, there are no plans to address it further or fix it in an upcoming release.  Therefore, it is being closed.  If plans change such that this issue will be fixed in an upcoming release, then the bug can be reopened.


Note You need to log in before you can comment on or make changes to this bug.