summaryrefslogtreecommitdiffstats
path: root/arch/um/drivers/ubd_kern.c
diff options
context:
space:
mode:
authorMartin Pärtel <martin.partel@gmail.com>2012-08-02 00:44:22 +0200
committerRichard Weinberger <richard@nod.at>2012-08-02 00:44:49 +0200
commitd4afcba95fca4dd0f831fe72c1fa4f0638f23765 (patch)
tree938dad1dd5cb1b0abf9946cf40b050d95c4bffd4 /arch/um/drivers/ubd_kern.c
parentb8a420952336ed81ef5c9bf8bad90d3deaee5521 (diff)
downloadblackbird-op-linux-d4afcba95fca4dd0f831fe72c1fa4f0638f23765.tar.gz
blackbird-op-linux-d4afcba95fca4dd0f831fe72c1fa4f0638f23765.zip
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 <martin.partel@gmail.com> Signed-off-by: Richard Weinberger <richard@nod.at>
Diffstat (limited to 'arch/um/drivers/ubd_kern.c')
-rw-r--r--arch/um/drivers/ubd_kern.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/um/drivers/ubd_kern.c b/arch/um/drivers/ubd_kern.c
index 20505cafa299..0643e5bc9f41 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;
OpenPOWER on IntegriCloud