]> git.ipfire.org Git - thirdparty/util-linux.git/commit
lib/loopdev: fix loopcxt_check_size() to work with blkdevs
authorKarel Zak <kzak@redhat.com>
Mon, 13 May 2013 08:54:41 +0000 (10:54 +0200)
committerKarel Zak <kzak@redhat.com>
Mon, 13 May 2013 08:54:41 +0000 (10:54 +0200)
commite3b6cb87e0ba1304fa07ec316784de1c6243b28e
treeb8c627bd2e5d31330a9c81c6a0526bc9045064b9
parent5673f30de61598def3f50c4285e09e70f5706d48
lib/loopdev: fix loopcxt_check_size() to work with blkdevs

The loopcxt_check_size() is workaround for kernels < v3.9, kernel has
been fixed by commit 541c742a7559eb65f0e36d3e2338c2ca532a3e61.

The function sets loopdev size according to backing file size. The
problem is that the backing file could be a block device where
stat.st_size is zero, so we have to use blkdev_get_size() for block
devices.

Addresses: https://bugs.archlinux.org/task/35193
Reported-by: Dave Reisner <d@falconindy.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
lib/loopdev.c