summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Pärtel <martin.partel@gmail.com>2012-08-02 02:44:22 +0400
committerRichard Weinberger <richard@nod.at>2012-08-02 02:44:49 +0400
commitd4afcba95fca4dd0f831fe72c1fa4f0638f23765 (patch)
tree938dad1dd5cb1b0abf9946cf40b050d95c4bffd4
parentb8a420952336ed81ef5c9bf8bad90d3deaee5521 (diff)
downloadlinux-d4afcba95fca4dd0f831fe72c1fa4f0638f23765.tar.xz
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>
-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;