From d4afcba95fca4dd0f831fe72c1fa4f0638f23765 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Martin=20P=C3=A4rtel?= Date: Thu, 2 Aug 2012 00:44:22 +0200 Subject: [PATCH] um: fix ubd_file_size for read-only files MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- arch/um/drivers/ubd_kern.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- 2.20.1