From: Lukas Wunner <lukas@wunner.de>
To: lvm-devel@redhat.com
Subject: [PATCH] dmsetup: Set exit code to 1 if remove_all fails to remove all devices
Date: Tue, 2 Dec 2014 22:00:45 +0100 [thread overview]
Message-ID: <20141202210045.GA8939@wunner.de> (raw)
In-Reply-To: <547E0FF0.70605@redhat.com>
Hi,
On Tue, Dec 02, 2014 at 08:16:00PM +0100, Zdenek Kabelac wrote:
> It really is meant to remove only not opened devices.
Sorry but that's not the point.
The interpretation of a program's exit status by the Shell is inverse
to the semantics in C. An exit status of 0 denotes success, a non-zero
exit status denotes failure.
The point is that, as evidenced by the dracut shutdown script I mentioned,
people expect the exit status of "dmsetup remove_all" to be non-zero if
the program failed to remove all devices. It's perfectly okay if it failed
to remove all devices. No need to remove devices that are still open.
But the program should *tell* the user that some devices could not be
closed (at the very least by returning with a non-zero exit status).
Right now the exit status of "dmsetup remove_all" is always 0, thus
pretending success.
As for the dracut shutdown script allegedly being broken: That script
was written by Harald Hoyer who works for the same company as you do
and is shipped with RHEL as well as Fedora. Just saying...
To provide some context: Dracut has a number of shutdown scripts that
are called round-robin until all succeed. This is useful for complex
LVM setups, e.g. a device mapper target layered on top of ZFS, with the
ZFS pool itself being backed by another device mapper target. To properly
untangle this, the dm-shutdown script should close the top-layered
device mapper target, next a zfs-shutdown script will export the zpool,
and finally another invocation of the dm-shutdown script will close
the bottom-layered device mapper target.
For this to work, the exit status of "dmsetup remove_all" must be
non-zero on failure, otherwise the dm-shutdown script cannot determine
whether it's work is done.
Therefore, please consider merging this patch.
Kind regards,
Lukas
next prev parent reply other threads:[~2014-12-02 21:00 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-02 17:58 [PATCH] dmsetup: Set exit code to 1 if remove_all fails to remove all devices Lukas Wunner
2014-12-02 19:16 ` Zdenek Kabelac
2014-12-02 21:00 ` Lukas Wunner [this message]
2014-12-02 21:12 ` Zdenek Kabelac
2014-12-06 21:25 ` Lukas Wunner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20141202210045.GA8939@wunner.de \
--to=lukas@wunner.de \
--cc=lvm-devel@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.