From: Martin Pärtel Date: Wed, 1 Aug 2012 22:44:22 +0000 (+0200) Subject: um: fix ubd_file_size for read-only files X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=d4afcba95fca4dd0f831fe72c1fa4f0638f23765;p=GitHub%2FLineageOS%2Fandroid_kernel_samsung_universal7580.git um: fix ubd_file_size for read-only files Made ubd_file_size not request write access. Fixes use of read-only images. Signed-off-by: Martin Pärtel Signed-off-by: Richard Weinberger --- diff --git a/arch/um/drivers/ubd_kern.c b/arch/um/drivers/ubd_kern.c index 20505cafa29..0643e5bc9f4 100644 --- a/arch/um/drivers/ubd_kern.c +++ b/arch/um/drivers/ubd_kern.c @@ -514,7 +514,7 @@ static inline int ubd_file_size(struct ubd *ubd_dev, __u64 *size_out) goto out; } - fd = os_open_file(ubd_dev->file, global_openflags, 0); + fd = os_open_file(ubd_dev->file, of_read(OPENFLAGS()), 0); if (fd < 0) return fd;