]> git.baikalelectronics.ru Git - kernel.git/commit
Tools: hv: vss: fix loop device detection
authorVitaly Kuznetsov <vkuznets@redhat.com>
Tue, 5 Jun 2018 20:37:56 +0000 (13:37 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 3 Jul 2018 11:02:33 +0000 (13:02 +0200)
commit874338810fb9b7ab4f885f5ba68814e98cd86238
tree86bbf9cffe842672847c5323e5fc3c09f34f2712
parentb9bb0ed6e9614563aea5b39a4d8431a93297c03f
Tools: hv: vss: fix loop device detection

Commit 452c587a5e0e ("Tools: hv: vss: Skip freezing filesystems backed by
loop") added skip for filesystems backed by loop device. However, it seems
the detection of such cases is incomplete.

It was found that with 'devicemapper' storage driver docker creates the
following chain:

NAME MAJ:MIN
loop0 7:0
..docker-8:4-8473394-pool 253:0
  ..docker-8:4-8473394-eac... 253:1

so when we're looking at the mounted device we see major '253' and not '7'.

Solve the issue by walking /sys/dev/block/*/slaves chain and checking if
there's a loop device somewhere.

Other than that, don't skip mountpoints silently when stat() fails. In case
e.g. SELinux is failing stat we don't want to skip freezing everything
without letting user know about the failure.

Fixes: 452c587a5e0e ("Tools: hv: vss: Skip freezing filesystems backed by loop")
Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
tools/hv/hv_vss_daemon.c