Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12-SP1:Update
mdadm.5365
0085-Manage-stop-guard-against-completed-being-...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0085-Manage-stop-guard-against-completed-being-too-large.patch of Package mdadm.5365
From 30ddba7de56f598f2ebb5a8a36c7ee8282a54dbd Mon Sep 17 00:00:00 2001 From: NeilBrown <neilb@suse.de> Date: Mon, 6 Jul 2015 13:33:20 +1000 Subject: [PATCH 119/359] Manage/stop: guard against 'completed' being too large. References: bsc#1081910 A race can allow 'completed' to read as 2^63-1, which takes a long time to count up to. So guard against that possibility. Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: Coly Li <colyli@suse.de> --- Manage.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Manage.c b/Manage.c index 17d66de..aeb90dd 100644 --- a/Manage.c +++ b/Manage.c @@ -400,6 +400,7 @@ int Manage_stop(char *devname, int fd, int verbose, int will_retry) delay = 3000; scfd = sysfs_open(mdi->sys_name, NULL, "sync_completed"); while (scfd >= 0 && delay > 0 && old_sync_max > 0) { + unsigned long long max_completed; sysfs_get_ll(mdi, NULL, "reshape_position", &curr); sysfs_fd_get_str(scfd, buf, sizeof(buf)); if (strncmp(buf, "none", 4) == 0) { @@ -413,7 +414,10 @@ int Manage_stop(char *devname, int fd, int verbose, int will_retry) break; } - if (sysfs_fd_get_ll(scfd, &completed) == 0 && + if (sysfs_fd_get_two(scfd, &completed, + &max_completed) == 2 && + /* 'completed' sometimes reads as max-uulong */ + completed < max_completed && (completed > sync_max || (completed == sync_max && curr != position))) { while (completed > sync_max) { -- 2.16.1
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