From: NeilBrown Date: Thu, 18 Dec 2008 03:04:45 +0000 (+1100) Subject: Kill: Don't use O_EXCL when --force is used. X-Git-Tag: mdadm-2.6.9~13 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=22eba5121632c4b26541fbb04209a90b93c24bcc;p=thirdparty%2Fmdadm.git Kill: Don't use O_EXCL when --force is used. We really want --zero-super --force to zero the superblock in all situations. So don't open with O_EXCL - trust the user. Signed-off-by: NeilBrown --- diff --git a/Kill.c b/Kill.c index 0a2763ea..b1e19b56 100644 --- a/Kill.c +++ b/Kill.c @@ -44,7 +44,7 @@ int Kill(char *dev, int force, int quiet) int fd, rv = 0; struct supertype *st; - fd = open(dev, O_RDWR|O_EXCL); + fd = open(dev, O_RDWR|(force ? 0 : O_EXCL)); if (fd < 0) { if (!quiet) fprintf(stderr, Name ": Couldn't open %s for write - not zeroing\n",