From: Doug Ledford <dledford@redhat.com>
To: Linux RAID Mailing List <linux-raid@vger.kernel.org>,
Neil Brown <neilb@suse.de>,
Dan Williams <dan.j.williams@intel.com>
Subject: Re: [Patch mdadm] Add hot-unplug support to mdadm
Date: Tue, 06 Apr 2010 12:26:15 -0400 [thread overview]
Message-ID: <4BBB60A7.9030205@redhat.com> (raw)
In-Reply-To: <4BBA1289.4010705@redhat.com>
[-- Attachment #1.1: Type: text/plain, Size: 2577 bytes --]
On 04/05/2010 12:40 PM, Doug Ledford wrote:
> We have incremental mode for supporting hot plug of devices. However,
> we don't support hot-unplug. This is something we need in order to
> enable automatic device replacement. When implementing the support
> though, I found that we had a problem in that the device special file is
> already gone (well, not gone, but both open and lstat fail on the device
> special file, which really makes Manage_subdevs unhappy) by the time
> udev calls us to remove the device (even if I created a new udev rules
> file with a very low number this was still true). So, along with adding
> the code shamelessly stolen from Hawrylewicz with modifications to make
> it work on non-container based arrays, I had to modify Manage_subdevs to
> work on sysfs subdevice entries in the fail and remove cases. Anyway,
> with this in place, and with the modified udev rules file in place,
> hot-unplug now works (or at least it does in my testing, I didn't try a
> container device, I'll leave tweaking that to Dan or someone else from
> Intel, although it should more or less work, I don't know the Intel
> metadata rules and so didn't try to make it work myself). And by
> changing Manage_subdevs to use either a valid device special file or
> sysfs entries, it will work on the command line with virtually any
> kernel, and work from a udev rules file on kernels recent enough to have
> the state entry in sysfs subdevs directories.
>
> Oh, and Neil should review my man page additions to see if they are
> sufficient for his tastes. I didn't get real wordy about the support,
> it's pretty straight forward.
>
Minor incremental fixup: In the case of passing in faulty or
disconnected as the device name, since we now use the value of tfd to
determine if we should attempt ioctls or go straight to using sysfs
entries, we now need to make sure we init tdf and then set it properly
in both of the loops where we check for faulty and disconnected devices
(although I'm now highly suspicious of the faulty check code as I
suspect all the faulty devices will have the same problem that our hot
unplug code ran into and the faulty devices will not be openable and
that will mean that passing in faulty is probably just broken at this
point in time...but that's another patch for another day).
--
Doug Ledford <dledford@redhat.com>
GPG KeyID: CFBFF194
http://people.redhat.com/dledford
Infiniband specific RPMs available at
http://people.redhat.com/dledford/Infiniband
[-- Attachment #1.2: mdadm-3.1.2-decremental-2.patch --]
[-- Type: text/plain, Size: 1028 bytes --]
commit ddda49f6daf481471334f5675fbc1fa149d83ad6
Author: Doug Ledford <dledford@redhat.com>
Date: Tue Apr 6 12:17:25 2010 -0400
Minor bug fix to incremental remove support
Signed-off-by: Doug Ledford <dledford@redhat.com>
diff --git a/Manage.c b/Manage.c
index 6539eda..b15586b 100644
--- a/Manage.c
+++ b/Manage.c
@@ -386,6 +386,7 @@ int Manage_subdevs(char *devname, int fd,
next = dv->next;
jnext = 0;
+ tfd = -1;
if (strcmp(dv->devname, "failed")==0 ||
strcmp(dv->devname, "faulty")==0) {
@@ -406,6 +407,7 @@ int Manage_subdevs(char *devname, int fd,
stb.st_rdev = makedev(disc.major, disc.minor);
next = dv;
jnext = j+1;
+ tfd = 0;
sprintf(dvname,"%d:%d", disc.major, disc.minor);
dnprintable = dvname;
break;
@@ -440,6 +442,7 @@ int Manage_subdevs(char *devname, int fd,
stb.st_rdev = makedev(disc.major, disc.minor);
next = dv;
jnext = j+1;
+ tfd = 0;
dnprintable = dvname;
break;
}
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
next prev parent reply other threads:[~2010-04-06 16:26 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-05 16:40 [Patch mdadm] Add hot-unplug support to mdadm Doug Ledford
2010-04-06 16:26 ` Doug Ledford [this message]
2010-04-07 1:30 ` Neil Brown
2010-04-07 2:02 ` Doug Ledford
2010-04-07 2:24 ` Doug Ledford
2010-04-07 3:07 ` Doug Ledford
2010-04-07 5:32 ` Luca Berra
2010-04-07 6:59 ` Neil Brown
2010-04-08 23:31 ` Neil Brown
2010-04-09 0:33 ` Neil Brown
2010-04-09 20:02 ` Doug Ledford
2010-04-13 9:28 ` Tomáš Dulík
2010-04-13 16:27 ` Doug Ledford
2010-04-13 18:49 ` Doug Ledford
[not found] ` <4BC5ADB2.2060705@unart.cz>
2010-04-15 5:24 ` Neil Brown
2010-04-15 13:11 ` Tomáš Dulík
2010-04-13 19:04 ` Doug Ledford
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=4BBB60A7.9030205@redhat.com \
--to=dledford@redhat.com \
--cc=dan.j.williams@intel.com \
--cc=linux-raid@vger.kernel.org \
--cc=neilb@suse.de \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.