um: fix ubd_file_size for read-only files
authorMartin Pärtel <martin.partel@gmail.com>
Wed, 1 Aug 2012 22:44:22 +0000 (00:44 +0200)
committerRichard Weinberger <richard@nod.at>
Wed, 1 Aug 2012 22:44:49 +0000 (00:44 +0200)
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>
arch/um/drivers/ubd_kern.c

index 20505cafa29904f176b735f98cdc94eeaac50181..0643e5bc9f41310b78f5b8cc36cc7abb6175e4f3 100644 (file)
@@ -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;