lvmstrap: add an explicit test for mounted devices
authorIustin Pop <iustin@google.com>
Wed, 19 Jan 2011 13:46:44 +0000 (14:46 +0100)
committerIustin Pop <iustin@google.com>
Thu, 20 Jan 2011 12:05:37 +0000 (13:05 +0100)
commit5e86105184edb12bfd304fe264b39880f4cea23c
treeb814dd1a8200e5f39c8fdccc7bc47a3a7ac8271c
parent6714256cfaac44e6db3b5c3744e65cbab4bfb62d
lvmstrap: add an explicit test for mounted devices

Recent kernels/userland report a mounted filesystem as follows:

    root@node4:~# fuser -avm /dev/sda5
                         USER        PID ACCESS COMMAND
    /dev/sda5:           root     kernel mount /srv/ganeti

But old ones do not:

    node1# fuser -avm /dev/sda5
                         USER        PID ACCESS COMMAND
    /dev/sda5:

So in order to cover both, we add an explicit test for this. We
already compute the device numbers of all mounted filesystems, so it
is a trivial addition (GetMountInfo() is cheap, so we don't need to
cache it).

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
tools/lvmstrap