Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12-SP4:Update
mdadm.5365
0084-Monitor-don-t-Wait-forever-on-a-frozen-arr...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0084-Monitor-don-t-Wait-forever-on-a-frozen-array.patch of Package mdadm.5365
From d3f6cf4f9bf670d36f51a8c0825755523fa6197c Mon Sep 17 00:00:00 2001 From: NeilBrown <neilb@suse.de> Date: Mon, 6 Jul 2015 13:26:41 +1000 Subject: [PATCH 118/359] Monitor: don't Wait forever on a 'frozen' array. References: bsc#1081910 If Wait() finds the array resync is 'frozen', then wait a little while to avoid races, but don't wait forever. Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: Coly Li <colyli@suse.de> --- Monitor.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Monitor.c b/Monitor.c index a530032..f19c2e5 100644 --- a/Monitor.c +++ b/Monitor.c @@ -993,6 +993,7 @@ int Wait(char *dev) struct stat stb; char devnm[32]; int rv = 1; + int frozen_remaining = 3; if (stat(dev, &stb) != 0) { pr_err("Cannot find %s: %s\n", dev, @@ -1009,7 +1010,7 @@ int Wait(char *dev) if (strcmp(e->devnm, devnm) == 0) break; - if (e->percent == RESYNC_NONE) { + if (e && e->percent == RESYNC_NONE) { /* We could be in the brief pause before something * starts. /proc/mdstat doesn't show that, but * sync_action does. @@ -1019,8 +1020,15 @@ int Wait(char *dev) sysfs_init(&mdi, -1, devnm); if (sysfs_get_str(&mdi, NULL, "sync_action", buf, 20) > 0 && - strcmp(buf,"idle\n") != 0) + strcmp(buf,"idle\n") != 0) { e->percent = RESYNC_UNKNOWN; + if (strcmp(buf, "frozen\n") == 0) { + if (frozen_remaining == 0) + e->percent = RESYNC_NONE; + else + frozen_remaining -= 1; + } + } } if (!e || e->percent == RESYNC_NONE) { if (e && e->metadata_version && -- 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