Kill: fix when zeroing busy devices.
PATCH 1/1 Kill: fix when zeroing busy devices.
mdadm should not wait indefinitely when it trys to reset superblock on device which is busy (cannot be opened).
--- Kill.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
Kill.c +1 -1
@@ -46,7 +46,7 @@ int Kill(char *dev, struct supertype *st, int force, int quiet, int noexcl)fprintf (stderr, Name": Couldn't open %s for write - not zeroing\n" , dev);close (fd); -return 1 ; +return 2 ; }if (st ==NULL ) st =guess_super (fd);
Quoted 13 lines · Artur Wojcik
mdadm should not wait indefinitely when it trys to reset superblock on device which is busy (cannot be opened).
Signed-off-by Artur Wojcik <[email protected]>--- Kill.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)Kill.c +0
-0
Kill.c int Kill(char *dev, struct supertype *st, int force, int quiet, int noexcl) · line 52
Quoted 8 lines
Kill.c +1
-1@@ -46,7 +46,7 @@ int Kill(char *dev, struct supertype *st, int force, int quiet, int noexcl)fprintf (stderr, Name": Couldn't open %s for write - not zeroing\n" , dev);close (fd); -return 1 ; +return 2 ; }if (st ==NULL ) st =guess_super (fd);
Jup.
BTW: Mind to kill the close(fd) as well (as fd is negative) while we're at it? A comment that explains the meaning of the return value would also be nice.
Thanks
Andre
Signature · 1 line
The only person who always got his work done by Friday was Robinson Crusoe
Quoted 3 lines · On Thu, 28 Jan 2010 17:31:57 +0100 Andre Noll <[email protected]> wrote:
Quoted 2 lines · Artur Wojcik
mdadm should not wait indefinitely when it trys to reset superblock on device which is busy (cannot be opened).
Thanks.
Quoted 22 lines
Quoted 11 lines
Signed-off-by Artur Wojcik <[email protected]>--- Kill.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)Kill.c +0
-0Kill.c int Kill(char *dev, struct supertype *st, int force, int quiet, int noexcl) · line 52
Quoted 8 lines
Kill.c +1
-1@@ -46,7 +46,7 @@ int Kill(char *dev, struct supertype *st, int force, int quiet, int noexcl)fprintf (stderr, Name": Couldn't open %s for write - not zeroing\n" , dev);close (fd); -return 1 ; +return 2 ; }if (st ==NULL ) st =guess_super (fd);Jup.
Quoted 5 lines
Acked-by Andre Noll <[email protected]>BTW: Mind to kill the close(fd) as well (as fd is negative) while we're at it? A comment that explains the meaning of the return value would also be nice.
Done and done.
I really don't know why the loop in mdadm.c cared about the different possible return values - I cannot see any justification for it.
Thanks,
NeilBrown