diff options
author | Martin Pärtel <martin.partel@gmail.com> | 2012-08-01 18:44:22 -0400 |
---|---|---|
committer | Richard Weinberger <richard@nod.at> | 2012-08-01 18:44:49 -0400 |
commit | d4afcba95fca4dd0f831fe72c1fa4f0638f23765 (patch) | |
tree | 938dad1dd5cb1b0abf9946cf40b050d95c4bffd4 /arch | |
parent | b8a420952336ed81ef5c9bf8bad90d3deaee5521 (diff) |
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')
-rw-r--r-- | arch/um/drivers/ubd_kern.c | 2 |
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) | |||
514 | goto out; | 514 | goto out; |
515 | } | 515 | } |
516 | 516 | ||
517 | fd = os_open_file(ubd_dev->file, global_openflags, 0); | 517 | fd = os_open_file(ubd_dev->file, of_read(OPENFLAGS()), 0); |
518 | if (fd < 0) | 518 | if (fd < 0) |
519 | return fd; | 519 | return fd; |
520 | 520 | ||