[PATCH] mount, losetup: Document loop destroy behavior

Stanislav Brabec <[email protected]>
Newsgroups org.kernel.vger.util-linux
Organization SUSE Linux, s. r. o.
Message-ID <[email protected]>
The loop device detach runs asynchronously in the background. It can cause
unexpected errors. Document the possible existence of the loop device after
exit of losetup -d or umount and need of "udevadm settle".

Signed-off-by: Stanislav Brabec <[email protected]>
---
  sys-utils/losetup.8.adoc | 2 +-
  sys-utils/umount.8.adoc  | 2 ++
  2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/sys-utils/losetup.8.adoc b/sys-utils/losetup.8.adoc
index 9ea9451ce..e22e650b8 100644
--- a/sys-utils/losetup.8.adoc
+++ b/sys-utils/losetup.8.adoc
@@ -54,7 +54,7 @@ The _size_ and _offset_ arguments may be followed by 
the multiplicative suffixes
  Show the status of all loop devices. Note that not all information is 
accessible for non-root users. See also *--list*. The old output format 
(as printed without *--list*) is deprecated.

  *-d*, *--detach* _loopdev_...::
-Detach the file or device associated with the specified loop device(s). 
Note that since Linux v3.7 kernel uses "lazy device destruction". The 
detach operation does not return *EBUSY* error anymore if device is 
actively used by system, but it is marked by autoclear flag and 
destroyed later.
+Detach the file or device associated with the specified loop device(s). 
Note that since Linux v3.7 kernel uses "lazy device destruction". The 
detach operation does not return *EBUSY* error anymore if device is 
actively used by system, but it is marked by autoclear flag and 
destroyed later. Even if the device is not used, the loop device can be 
destroyed later. If you need to wait for a complete removal of the loop 
device, call *udevadm settle* after *losetup*.

  *-D*, *--detach-all*::
  Detach all associated loop devices.
diff --git a/sys-utils/umount.8.adoc b/sys-utils/umount.8.adoc
index f9b96e1ff..b9a3ff963 100644
--- a/sys-utils/umount.8.adoc
+++ b/sys-utils/umount.8.adoc
@@ -127,6 +127,8 @@ The *umount* command will automatically detach loop 
device previously initialize

  In this case the device is initialized with "autoclear" flag (see 
*losetup*(8) output for more details), otherwise it's necessary to use 
the option *--detach-loop* or call *losetup -d* _device_. The autoclear 
feature is supported since Linux 2.6.25.

+Note that since Linux v3.7 kernel uses "lazy device destruction". The 
system just marks the loop device by autoclear flag and destroys it 
later. If you need to wait for a complete removal of the loop device, 
call *udevadm settle* after *umount*.
+
  == EXIT STATUS

  *umount* has the following exit status values (the bits can be ORed):
-- 
2.45.0

-- 
Best Regards / S pozdravem,

Stanislav Brabec
software developer
---------------------------------------------------------------------
SUSE LINUX, s. r. o.                         e-mail: [email protected]
Křižíkova 148/34 (Corso IIa)                    tel: +420 284 084 060
186 00 Praha 8-Karlín                          fax:  +420 284 084 001
Czech Republic                                    http://www.suse.cz/
PGP: 830B 40D5 9E05 35D8 5E27 6FA3 717C 209F A04F CD76
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.