From: Martin Wilck <mwilck@arcor.de>
To: Albert Pauw <albert.pauw@gmail.com>, linux-raid@vger.kernel.org
Subject: Re: Bugreport ddf rebuild problems
Date: Thu, 01 Aug 2013 23:13:32 +0200 [thread overview]
Message-ID: <51FACF7C.50400@arcor.de> (raw)
In-Reply-To: <CAGkViCFT0+qm9YAnAJM7JGgVg0RTJi8=HAYDTMs-mfhXinqdcg@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 58 bytes --]
Can you please try the attached patch?
Regards,
Martin
[-- Attachment #2: 0001-DDF-ddf_process_update-delete-removed-disks-from-dli.patch --]
[-- Type: text/x-patch, Size: 1799 bytes --]
From e6b25d31ee79c1191f936e178324c97d2ce68a57 Mon Sep 17 00:00:00 2001
From: Martin Wilck <mwilck@arcor.de>
Date: Fri, 2 Aug 2013 00:11:20 +0200
Subject: [PATCH] DDF: ddf_process_update: delete removed disks from dlist
We currently remove Failed disks that are no longer used by any
VD. If we do that, we must remove them from dlist, too, because
otherwise the same pdnum may occur multiple times in the dlist.
---
super-ddf.c | 24 +++++++++++++++++++++---
1 files changed, 21 insertions(+), 3 deletions(-)
diff --git a/super-ddf.c b/super-ddf.c
index 65472a2..f8d5fcd 100644
--- a/super-ddf.c
+++ b/super-ddf.c
@@ -4366,6 +4366,18 @@ static void copy_matching_bvd(struct ddf_super *ddf,
conf->sec_elmnt_seq, guid_str(conf->guid));
}
+static void _delete_dl_by_refnum(struct ddf_super *ddf, be32 refnum)
+{
+ struct dl **pdl = &ddf->dlist;
+ while (*pdl) {
+ if (be32_eq((*pdl)->disk.refnum, refnum)) {
+ free(*pdl);
+ *pdl = (*pdl)->next;
+ } else
+ pdl = &(*pdl)->next;
+ }
+}
+
static void ddf_process_update(struct supertype *st,
struct metadata_update *update)
{
@@ -4638,9 +4650,15 @@ static void ddf_process_update(struct supertype *st,
if (be16_and(ddf->phys->entries[pdnum].state,
cpu_to_be16(DDF_Failed))
&& be16_and(ddf->phys->entries[pdnum].state,
- cpu_to_be16(DDF_Transition)))
- /* skip this one */;
- else if (pdnum == pd2)
+ cpu_to_be16(DDF_Transition))) {
+ /* skip this one and remove from dlist */
+ dprintf("%s: %08x no longer used, removing it\n",
+ __func__,
+ be32_to_cpu(ddf->phys->
+ entries[pdnum].refnum));
+ _delete_dl_by_refnum(
+ ddf, ddf->phys->entries[pdnum].refnum);
+ } else if (pdnum == pd2)
pd2++;
else {
ddf->phys->entries[pd2] =
--
1.7.1
next prev parent reply other threads:[~2013-08-01 21:13 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-01 19:30 Bugreport ddf rebuild problems Albert Pauw
2013-08-01 19:09 ` Martin Wilck
[not found] ` <CAGkViCFT0+qm9YAnAJM7JGgVg0RTJi8=HAYDTMs-mfhXinqdcg@mail.gmail.com>
2013-08-01 21:13 ` Martin Wilck [this message]
2013-08-01 22:09 ` Martin Wilck
2013-08-01 22:37 ` Martin Wilck
2013-08-03 9:43 ` Albert Pauw
2013-08-04 9:47 ` Albert Pauw
2013-08-05 16:55 ` Albert Pauw
2013-08-05 21:24 ` Martin Wilck
2013-08-06 0:16 ` NeilBrown
2013-08-06 21:26 ` Martin Wilck
2013-08-06 21:37 ` Patches related to current discussion mwilck
2013-08-06 21:38 ` [PATCH 6/9] tests/10ddf-fail-spare: more sophisticated result checks mwilck
2013-08-06 21:38 ` [PATCH 7/9] tests/10ddf-fail-create-race: test handling of fail/create race mwilck
2013-08-06 21:38 ` [PATCH 8/9] DDF: ddf_open_new: check device status for new subarray mwilck
2013-08-06 21:38 ` [PATCH 9/9] Create: set array status to frozen until monitoring starts mwilck
2013-08-08 0:44 ` NeilBrown
2013-08-08 7:31 ` Martin Wilck
2013-08-07 18:07 ` Bugreport ddf rebuild problems Albert Pauw
2013-08-08 0:40 ` NeilBrown
[not found] <CAGkViCHPvbmcehFvACBKVFFCw+DdnjqvK2uNGmvKrFki+n9n-Q@mail.gmail.com>
2013-08-05 6:21 ` NeilBrown
2013-08-05 7:17 ` Albert Pauw
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=51FACF7C.50400@arcor.de \
--to=mwilck@arcor.de \
--cc=albert.pauw@gmail.com \
--cc=linux-raid@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.