All of lore.kernel.org
 help / color / mirror / Atom feed
From: Milan Broz <gmazyland@gmail.com>
To: ".. ink .." <mhogomchungu@gmail.com>
Cc: dm-crypt@saout.de
Subject: Re: [dm-crypt] an official way to know if the underlying device is gone for all supported volume formats
Date: Mon, 18 Mar 2013 23:01:40 +0100	[thread overview]
Message-ID: <51478EC4.4020006@gmail.com> (raw)
In-Reply-To: <CAFnMBaS_awqpi5WaR59N3Ju_9X9RAVkturUnb4K3W4-vFCpVEw@mail.gmail.com>


On 18.3.2013 7:30, .. ink .. wrote:
>
> http://code.google.com/p/cryptsetup/source/detail?r=f64064fe71363a14ab0c62359e451f9cdc39dc50
>
>  The above commit log speaks of LUKS volumes,what about plain and
> cryptsetup volumes? The return code for LUKS is vague too since the
> log is not clear.

plain device doesn't have this problem, it initializes completely from
mapping table (no real problem if underlying device disappeared).

> I remember asking a way to know if the underlying devise is gone but
> my request went unaswered,i therefore use the following hack in line
> 97 and 98 in the below source file to know.It would be nice if there
> was an official way for all three types.

But it is not cryptsetup job. libcryptsetup just need to cope with situation
when underlying device disappear and "handle" it reliably.

(Plain a LUKS is fundamentally different here - for plain you do not need
to read underlying device at all to initialise context but for
LUKS you need read LUKS header from underlying device.)

The only reliable way to properly track all situations when device
disappears I know is to listen udev events and react to remove event
(as e.g. udisks does).
Cryptsetup cannot do that, it has no running daemon which can listen
to these events.

Device "disappears" can mean many things. it can be intermittent (temporary)
or persistent problem (no reliable way to distinguish between these!)
Just to illustrate the problem, imagine these situations (every such situation
can behave slightly differently for userspace)

- raid device lost more members it can handle (degraded->failed)
- device node was removed (forced udev event) (but device itself is fine)
- usb device was removed, but still in use (mounted fs etc)
- network block device (iSCSI, nbd, DRBD, ...) is not responding (netword glitch)
or remote device failed
- device was put to offline mode (echo "offline" > /proc/....)
- underlying device-mapper device was remmaped to another device or error target
- disc controller failure (hard reset)
- disc itself crashed, not responding, randomly failing requests
- size of underlying device is (temporarily) 0
  (was seen in some enterprise disk arrays during reconfiguration)
- multipath device lost all paths
... and many others

The Linux storage stack can be very complicated and it is in general... a true mess :-)

Milan

  reply	other threads:[~2013-03-18 22:02 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-18  6:30 [dm-crypt] an official way to know if the underlying device is gone for all supported volume formats .. ink ..
2013-03-18 22:01 ` Milan Broz [this message]
2013-03-19  2:24   ` .. ink ..
2013-03-19  6:22     ` Milan Broz

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=51478EC4.4020006@gmail.com \
    --to=gmazyland@gmail.com \
    --cc=dm-crypt@saout.de \
    --cc=mhogomchungu@gmail.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.