Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Leap:42.2:Ports
mdadm
1002-bnc808647-retry-failed-removes.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 1002-bnc808647-retry-failed-removes.patch of Package mdadm
--- Manage.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) Index: mdadm-3.3.4/Manage.c =================================================================== --- mdadm-3.3.4.orig/Manage.c +++ mdadm-3.3.4/Manage.c @@ -1086,7 +1086,8 @@ int Manage_add(int fd, int tfd, struct m } int Manage_remove(struct supertype *tst, int fd, struct mddev_dev *dv, - int sysfd, unsigned long rdev, int verbose, char *devname) + int sysfd, unsigned long rdev, int force, int verbose, + char *devname) { int lfd = -1; int err; @@ -1144,7 +1145,9 @@ int Manage_remove(struct supertype *tst, else err = 0; } else { - err = ioctl(fd, HOT_REMOVE_DISK, rdev); + do { + err = ioctl(fd, HOT_REMOVE_DISK, rdev); + } while (err && errno == EBUSY && force && usleep(50000) == 0); if (err && errno == ENODEV) { /* Old kernels rejected this if no personality * is registered */ @@ -1566,9 +1569,13 @@ int Manage_subdevs(char *devname, int fd } } - if (dv->disposition == 'F') + if (dv->disposition == 'F') { /* Need to remove first */ - ioctl(fd, HOT_REMOVE_DISK, rdev); + int err; + do { + err = ioctl(fd, HOT_REMOVE_DISK, rdev); + } while (err && (errno == EBUSY) && force && (usleep(50000) == 0)); + } /* Make sure it isn't in use (in 2.6 or later) */ tfd = dev_open(dv->devname, O_RDONLY|O_EXCL); if (tfd >= 0) { @@ -1610,7 +1617,7 @@ int Manage_subdevs(char *devname, int fd rv = -1; } else rv = Manage_remove(tst, fd, dv, sysfd, - rdev, verbose, + rdev, force, verbose, devname); if (sysfd >= 0) close(sysfd);
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor