* [mdadm PATCH] Kill: fix when zeroing busy devices.
@ 2010-01-28 15:48 Artur Wojcik
2010-01-28 16:31 ` Andre Noll
0 siblings, 1 reply; 3+ messages in thread
From: Artur Wojcik @ 2010-01-28 15:48 UTC (permalink / raw)
To: linux-raid; +Cc: dan.j.williams, ed.ciechanowski
mdadm should not wait indefinitely when it trys to reset
superblock on device which is busy (cannot be opened).
Signed-off-by: Artur Wojcik <artur.wojcik@intel.com>
---
Kill.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/Kill.c b/Kill.c
index 63442a6..a65b865 100644
--- a/Kill.c
+++ b/Kill.c
@@ -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);
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [mdadm PATCH] Kill: fix when zeroing busy devices.
2010-01-28 15:48 [mdadm PATCH] Kill: fix when zeroing busy devices Artur Wojcik
@ 2010-01-28 16:31 ` Andre Noll
2010-01-29 10:02 ` Neil Brown
0 siblings, 1 reply; 3+ messages in thread
From: Andre Noll @ 2010-01-28 16:31 UTC (permalink / raw)
To: Artur Wojcik; +Cc: linux-raid, dan.j.williams, ed.ciechanowski
[-- Attachment #1: Type: text/plain, Size: 997 bytes --]
On 16:48, Artur Wojcik wrote:
> mdadm should not wait indefinitely when it trys to reset
> superblock on device which is busy (cannot be opened).
>
> Signed-off-by: Artur Wojcik <artur.wojcik@intel.com>
> ---
> Kill.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/Kill.c b/Kill.c
> index 63442a6..a65b865 100644
> --- a/Kill.c
> +++ b/Kill.c
> @@ -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.
Acked-by: Andre Noll <maan@systemlinux.org>
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
--
The only person who always got his work done by Friday was Robinson Crusoe
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [mdadm PATCH] Kill: fix when zeroing busy devices.
2010-01-28 16:31 ` Andre Noll
@ 2010-01-29 10:02 ` Neil Brown
0 siblings, 0 replies; 3+ messages in thread
From: Neil Brown @ 2010-01-29 10:02 UTC (permalink / raw)
To: Andre Noll; +Cc: Artur Wojcik, linux-raid, dan.j.williams, ed.ciechanowski
On Thu, 28 Jan 2010 17:31:57 +0100
Andre Noll <maan@systemlinux.org> wrote:
> On 16:48, Artur Wojcik wrote:
> > mdadm should not wait indefinitely when it trys to reset
> > superblock on device which is busy (cannot be opened).
Thanks.
> >
> > Signed-off-by: Artur Wojcik <artur.wojcik@intel.com>
> > ---
> > Kill.c | 2 +-
> > 1 files changed, 1 insertions(+), 1 deletions(-)
> >
> > diff --git a/Kill.c b/Kill.c
> > index 63442a6..a65b865 100644
> > --- a/Kill.c
> > +++ b/Kill.c
> > @@ -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.
>
> Acked-by: Andre Noll <maan@systemlinux.org>
>
> 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
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-01-29 10:02 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-28 15:48 [mdadm PATCH] Kill: fix when zeroing busy devices Artur Wojcik
2010-01-28 16:31 ` Andre Noll
2010-01-29 10:02 ` Neil Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).