From e8a70c89585ddca2bcb4160808f64506c64df13b Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Thu, 20 Nov 2008 14:51:42 +1100 Subject: mdmon: pass symbolic name to mdmon instead of device name. Now that names in /dev are usually created (eventually) by udev, it isn't really safe to rely in finding a name in /dev to pass to mdmon to identify which array to monitor. And it isn't really necessary to have a name in /dev. So just pass the symbolic name, e.g. md127 or md123. Change util.c to pass that name, and change mdmon to process the name sensibly. Signed-off-by: NeilBrown --- monitor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'monitor.c') diff --git a/monitor.c b/monitor.c index 15791f4..5c17910 100644 --- a/monitor.c +++ b/monitor.c @@ -469,7 +469,7 @@ static int wait_and_act(struct supertype *container, int nowait) * problem as there are no active arrays, there is * nothing that we need to be ready to do. */ - int fd = open(container->device_name, O_RDONLY|O_EXCL); + int fd = open_dev_excl(container->devnum); if (fd >= 0 || errno != EBUSY) { /* OK, we are safe to leave */ if (sigterm && !dirty_arrays) -- cgit