Commits
Kir Kolyshkin authored 4aeb62ae18a
ploop_mount(): check that mntpnt is dir Noticed while reading through source code that we only check param->target for existence, not that it's a directory. So, without this patch, the following happens: # touch mnt3 # ploop mount -r root.hdd -m mnt3 Adding delta dev=/dev/ploop0 img=root.hdd (ro) Error in ploop_mount_fs (ploop.c:967): Can't mount file system dev=/dev/ploop0p1 target=mnt3: Not a directory And then there's no rollback, i.e. image is left mounted to a device: # ls -l /dev/ploop0p1 brw-rw---- 1 root disk 182, 1 Sep 6 22:02 /dev/ploop0p1 While a proper rollback is probably required, for this specific case we can just check early that param->target is a directory. Reference: ploop@797656 Signed-off-by: Kir Kolyshkin <kir@openvz.org>