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 <neilb@suse.de>
This commit is contained in:
parent
504fb2e7f3
commit
22eba51216
2
Kill.c
2
Kill.c
|
@ -44,7 +44,7 @@ int Kill(char *dev, int force, int quiet)
|
||||||
int fd, rv = 0;
|
int fd, rv = 0;
|
||||||
struct supertype *st;
|
struct supertype *st;
|
||||||
|
|
||||||
fd = open(dev, O_RDWR|O_EXCL);
|
fd = open(dev, O_RDWR|(force ? 0 : O_EXCL));
|
||||||
if (fd < 0) {
|
if (fd < 0) {
|
||||||
if (!quiet)
|
if (!quiet)
|
||||||
fprintf(stderr, Name ": Couldn't open %s for write - not zeroing\n",
|
fprintf(stderr, Name ": Couldn't open %s for write - not zeroing\n",
|
||||||
|
|
Loading…
Reference in New Issue