Re: [Patch mdadm] Add hot-unplug support to mdadm

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Here's another minor incremental patch to the original.  This makes
hot-remove of imsm devices work.  The sanity tests just needed to be
updated to deal with an already missing device.

-- 
Doug Ledford <dledford@xxxxxxxxxx>
              GPG KeyID: CFBFF194
	      http://people.redhat.com/dledford

Infiniband specific RPMs available at
	      http://people.redhat.com/dledford/Infiniband
commit 1934c67fe5bc25a79393ad78e29bf9ef778bc701
Author: Doug Ledford <dledford@xxxxxxxxxx>
Date:   Tue Apr 6 23:02:47 2010 -0400

    Only close lfd if we have an external metadata type since that's the only
    time we'll have it open.
    
    If we weren't able to open the device file, assume the device is gone
    already and skip the sysfs_unique_holder test as it is guaranteed to
    fail.
    
    Signed-off-by: Doug Ledford <dledford@xxxxxxxxxx>

diff --git a/Manage.c b/Manage.c
index b15586b..a690cfc 100644
--- a/Manage.c
+++ b/Manage.c
@@ -811,6 +811,7 @@ int Manage_subdevs(char *devname, int fd,
 				 * rely on the 'detached' checks
 				 */
 				if (strcmp(dv->devname, "detached") == 0 ||
+				    tfd < 0 ||
 				    sysfs_unique_holder(dnum, stb.st_rdev))
 					/* pass */;
 				else {
@@ -878,8 +879,8 @@ int Manage_subdevs(char *devname, int fd,
 
 				ping_manager(name);
 				free(name);
+				close(lfd);
 			}
-			close(lfd);
 			if (verbose >= 0)
 				fprintf(stderr, Name ": hot removed %s\n",
 					dnprintable);

Attachment: signature.asc
Description: OpenPGP digital signature


[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux