diff options
author | NeilBrown <neilb@suse.de> | 2011-03-10 01:41:21 +0100 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2011-03-10 06:54:32 +0100 |
commit | a821dc7fdf2569a2ea371120771755c87a4f03d3 (patch) | |
tree | 0dbd94dfed89e2bb532f37bfcd566a1923bb344f /util.c | |
parent | ddf: exclude failed devices from container_content (diff) | |
download | mdadm-a821dc7fdf2569a2ea371120771755c87a4f03d3.tar.xz mdadm-a821dc7fdf2569a2ea371120771755c87a4f03d3.zip |
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 <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to '')
-rw-r--r-- | util.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -994,7 +994,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) |