Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Leap:42.1:Staging:C
mdadm
bnc808647-retry-failed-removes.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File bnc808647-retry-failed-removes.patch of Package mdadm
--- Manage.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) --- mdadm-3.3.orig/Manage.c +++ mdadm-3.3/Manage.c @@ -1027,7 +1027,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; @@ -1086,7 +1087,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 */ @@ -1473,10 +1476,14 @@ int Manage_subdevs(char *devname, int fd " operation on the parent container\n"); goto abort; } - if (dv->disposition == 'F') + if (dv->disposition == 'F') { /* Need to remove first */ - ioctl(fd, HOT_REMOVE_DISK, - (unsigned long)stb.st_rdev); + int err; + do { + err = ioctl(fd, HOT_REMOVE_DISK, + (unsigned long)stb.st_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) { @@ -1520,7 +1527,7 @@ int Manage_subdevs(char *devname, int fd rv = -1; } else rv = Manage_remove(tst, fd, dv, sysfd, - stb.st_rdev, verbose, + stb.st_rdev, verbose, force, 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