Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12-SP5:Update
mdadm.7129
1002-bnc808647-retry-failed-removes.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 1002-bnc808647-retry-failed-removes.patch of Package mdadm.7129
Subject: mdadm: retry failed removes References: fate#311379 --- Manage.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) Index: mdadm-3.3.1/Manage.c =================================================================== --- mdadm-3.3.1.orig/Manage.c +++ mdadm-3.3.1/Manage.c @@ -1110,7 +1110,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; @@ -1183,7 +1184,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 */ @@ -1605,9 +1608,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) { @@ -1649,7 +1656,7 @@ int Manage_subdevs(char *devname, int fd rv = -1; } else rv = Manage_remove(tst, fd, dv, sysfd, - rdev, verbose, + 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