From 82a7851e5f5575991967d953c33116f6f2d60072 Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Thu, 10 Mar 2011 11:41:21 +1100 Subject: [PATCH] dev_open should always open read-only. When opening an array to manipulate it we never need to write to the array and sometimes it might be read-only so the open for write will fail. So always open read-only. Reported-by: Adam Kwolek Signed-off-by: NeilBrown --- util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util.c b/util.c index 87c23dc..c22bb3b 100644 --- a/util.c +++ b/util.c @@ -1003,7 +1003,7 @@ int open_dev(int devnum) char buf[20]; sprintf(buf, "%d:%d", dev2major(devnum), dev2minor(devnum)); - return dev_open(buf, O_RDWR); + return dev_open(buf, O_RDONLY); } int open_dev_excl(int devnum)