linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: NeilBrown <neilb@suse.de>
To: Alexander Lyakas <alex.bolshoy@gmail.com>
Cc: linux-raid@vger.kernel.org
Subject: Re: mdadm/Monitor.c - never removes MD devices from statelist
Date: Wed, 21 Sep 2011 15:06:13 +1000	[thread overview]
Message-ID: <20110921150613.74e044f0@notabene.brown> (raw)
In-Reply-To: <CAGRgLy4=dMRmqZW4_+Wv+0QZzanH_ZCX88xxL5QD2OK03GmYww@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2071 bytes --]

On Mon, 12 Sep 2011 11:32:23 +0300 Alexander Lyakas <alex.bolshoy@gmail.com>
wrote:

> Hello Neil,
> yes, I will try to produce a patch (although I am using git, I have
> never done patches yet).

If you are using git, then patches are easy:

 git show --format=email


> 
> But I don't understand why do you require 'err' to be set. I would say
> that when there is a "DeviceDisappeared" event plus --scan is set,
> then you should remove. (And also perhaps if this array does not
> appear in the device list provided by the user).

A DeviceDisappeared event sets ->err to 1.  So testing ->err is an easy way
to test if the device disappeated.

It doesn't matter if the device was listed by the user: if --scan is set we
will find it again anyway.

NeilBrown


> 
> Alex.
> 
> 
> On Mon, Sep 12, 2011 at 6:36 AM, NeilBrown <neilb@suse.de> wrote:
> > On Sun, 11 Sep 2011 21:32:12 +0300 Alexander Lyakas <alex.bolshoy@gmail.com>
> > wrote:
> >
> >> Hi everybody,
> >> looking at the code of Monitor.c and doing some tests with it, I see
> >> that it is capable of detecting new arrays, when they appear in
> >> /proc/mdstat (if --scan is given). However, once array is added to
> >> 'statelist', it is never removed from there. Is this intentional?
> >> Perhaps only if --scan is given, and device disappears from
> >> /proc/mdstat, then it should be removed from monitoring, otherwise it
> >> could stick there forever, even though the array has been gone long
> >> time ago. And if it appears again, it will be picked up anyways.
> >>
> >
> > You are right - arrays are never removed.
> >
> > Is that a problem?  Probably not, though I guess you could probably create
> > a scenario where there were lots of inactive devices cluttering memory.
> >
> > Is it worth fixing?  I don't know - it depends on how intrusive the patch is.
> > We would only want to remove arrays with ->err set if 'scan' was set, but
> > when it is, it possible makes sense.
> >
> > Want to try creating a patch?
> >
> > NeilBrown
> >


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 190 bytes --]

      reply	other threads:[~2011-09-21  5:06 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-11 18:32 mdadm/Monitor.c - never removes MD devices from statelist Alexander Lyakas
2011-09-12  3:36 ` NeilBrown
2011-09-12  8:32   ` Alexander Lyakas
2011-09-21  5:06     ` NeilBrown [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110921150613.74e044f0@notabene.brown \
    --to=neilb@suse.de \
    --cc=alex.bolshoy@gmail.com \
    --cc=linux-raid@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).