um: fix ubd cow size
authorRichard Weinberger <richard@nod.at>
Wed, 2 Nov 2011 12:17:27 +0000 (13:17 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 11 Nov 2011 17:43:35 +0000 (09:43 -0800)
commit02e66bee63c63c2bec1947553e6c5b58b3f0c67d
treed8f3e5dc1f1f718d52c1c949dfcdc77e891afab3
parent9ae9f13480be10697214ed82f4a0f32681309822
um: fix ubd cow size

commit 8535639810e578960233ad39def3ac2157b0c3ec upstream.

ubd_file_size() cannot use ubd_dev->cow.file because at this time
ubd_dev->cow.file is not initialized.
Therefore, ubd_file_size() will always report a wrong disk size when
COW files are used.
Reading from /dev/ubd* would crash the kernel.

We have to read the correct disk size from the COW file's backing
file.

Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
arch/um/drivers/ubd_kern.c