From e3db28c4d77ff0dcd8cfbaa4a74d2238f03600d5 Mon Sep 17 00:00:00 2001 From: Frank Liepold Date: Thu, 25 Jul 2013 09:12:46 +0200 Subject: [PATCH] marsadm: correct wrong condition for checking exclusive access The fixed bug was introduced in commit: marsadm: 'create-resource' --force no longer checks for exclusive access --- userspace/marsadm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/userspace/marsadm b/userspace/marsadm index d9afc2ab..f9569868 100755 --- a/userspace/marsadm +++ b/userspace/marsadm @@ -865,7 +865,7 @@ sub create_res { ldie "block device '$dev' must be an absolute path starting with '/'\n" unless $dev =~ m/^\//; use Fcntl 'SEEK_END', 'O_RDONLY', 'O_RDWR', 'O_EXCL'; my $flags = O_RDWR | O_EXCL; - if (!$force) { + if ($force) { $flags = O_RDONLY; } sysopen(TEST, $dev, $flags) or ldie "cannot open device '$dev' for exclusive rw access\n";