From: "Bryn M. Reeves" <bmr@redhat.com>
To: device-mapper development <dm-devel@redhat.com>
Subject: Re: multipath -f/-F exit status
Date: Mon, 15 Dec 2008 17:35:41 +0000 [thread overview]
Message-ID: <4946956D.7030800@redhat.com> (raw)
In-Reply-To: <20081213125937.2ddc34d6@plop>
Christophe Varoqui wrote:
>> Hi Folks,
>>
>> Older versions of multipath-tools would always exit with status 0
>> (success) when flushing multipath device maps (-f/-F). This was never
>> guaranteed but happened because the "r" local in multipath/main.c was
>> used uninitialised in these code paths (by chance, it always lands on
>> a freshly zeroed stack page, so although undefined the behaviour was
>> pretty reliable).
>>
>> This was changed by commit 8497928514aa3df6d46f24d8d9b70b086e9fcfbd:
>>
> Then by a9a6c71592d4e2271a38c3d334bee7cbce963cff.
>
> Does the upstream version works as you expect in this regard ?
Sorry - not sure how I missed that last week.
>> The alternative for -F seems to be to return 0 if all unused maps were
>> flushed and 1 if there were unused maps that could not be flushed.
>> This doesn't seem like a very likely occurrence, but maybe it should
>> be handled separately?
>>
> I guess the current implementation return r as the number failures.
It does, which seems a slightly strange thing to return - I don't see
how it's useful as it's actually the number of device-mapper maps that
we couldn't flush (sum of returns from dm_flush_map), i.e. the total
number of maps that either weren't multipath, weren't unused etc :)
This will cause problems on systems that have 256 such maps since the
exit status is truncated to 8-bits and we would falsely reported the
status as zero.
It seems more useful to return an overall success/failure indication for
these commands and would be more in-keeping with other similar tools and
POSIX.
Regards,
Bryn.
next prev parent reply other threads:[~2008-12-15 17:35 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-13 11:59 multipath -f/-F exit status Christophe Varoqui
2008-12-15 17:35 ` Bryn M. Reeves [this message]
2008-12-17 23:05 ` Christophe Varoqui
2008-12-18 16:41 ` Bryn M. Reeves
-- strict thread matches above, loose matches on Subject: below --
2008-12-12 15:30 Bryn M. Reeves
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=4946956D.7030800@redhat.com \
--to=bmr@redhat.com \
--cc=dm-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.