From: Dan Williams <dan.j.williams@intel.com>
To: linux-raid@vger.kernel.org, neilb@suse.de
Subject: Re: [PATCH] (Re: Questions regarding startup of imsm container)
Date: Tue, 23 Mar 2010 16:06:39 -0700 [thread overview]
Message-ID: <e9c3a7c21003231606s388d26e6gba266e6a44281973@mail.gmail.com> (raw)
In-Reply-To: <20100323080419.GA9374@maude.comedia.it>
On Tue, Mar 23, 2010 at 1:04 AM, Luca Berra <bluca@comedia.it> wrote:
> The attached patch completely disables bitmap support for arrays with
> externally managed metadata.
It should be possible to use an external bitmap, but that requires
that you have storage separate from the raid array.
# mdadm --grow --bitmap=$(pwd)/test --force /dev/md125
# cat /proc/mdstat
Personalities : [raid1] [raid0]
md125 : active raid1 loop1[1] loop0[0]
100143 blocks super external:/md127/0 [2/2] [UU]
bitmap: 13/13 pages [52KB], 4KB chunk, file: /root/test
md127 : inactive loop1[1](S) loop0[0](S)
418 blocks super external:imsm
unused devices: <none>
> on a style note, i do not like having the struct superswitch, which is a
> collection of function pointers which is then instanced with only some
> of the pointers initialized, it forces having to check at runtime if
> they are or not.
In some cases this is a 'feature' as it is an optional implementation
detail of the metadata format whether it supports, or wants to
override a given operation. See ->default_layout() and
->detail_platform(). Another example is the small collection of
operations that are only applicable for mdmon to use.
I think something like this untested patch would be more appropriate
to fix the issue at hand.
diff --git a/bitmap.c b/bitmap.c
index 088e37d..054a507 100644
--- a/bitmap.c
+++ b/bitmap.c
@@ -227,6 +227,12 @@ bitmap_info_t *bitmap_file_read(char *filename,
int brief, struct supertype **st
if (!st) {
/* just look at device... */
lseek(fd, 0, 0);
+ } else if (!st->ss->locate_bitmap) {
+ fprintf(stderr, Name
+ ": %s-metadata arrays do not support
an internal bitmap\n",
+ st->ss->name);
+ close(fd);
+ return NULL;
} else {
st->ss->locate_bitmap(st, fd);
}
> a possible solution would be to wrap every call of these into a macro
> that check for NULL before, but how do you return the correct return
> type from that?
We need to fix up all the locations that assume md-metadata, once that
is done a macro is not needed.
--
Dan
next prev parent reply other threads:[~2010-03-23 23:06 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-23 3:56 Questions regarding startup of imsm container Randy Terbush
2010-03-23 8:04 ` [PATCH] (Re: Questions regarding startup of imsm container) Luca Berra
2010-03-23 12:58 ` Randy Terbush
2010-03-23 14:22 ` Luca Berra
2010-03-23 14:33 ` Randy Terbush
2010-03-23 14:49 ` Randy Terbush
2010-03-23 15:56 ` Luca Berra
2010-03-23 22:41 ` Dan Williams
2010-03-24 21:35 ` Randy Terbush
2010-03-23 23:06 ` Dan Williams [this message]
2010-03-24 0:57 ` [PATCH] " Neil Brown
2010-03-24 6:12 ` Luca Berra
2010-03-24 14:49 ` Dan Williams
2010-03-23 21:01 ` Questions regarding startup of imsm container Dan Williams
2010-03-23 21:41 ` Randy Terbush
2010-03-23 22:16 ` Dan Williams
2010-03-23 23:25 ` Randy Terbush
2010-03-24 0:23 ` Randy Terbush
2010-03-24 4:14 ` Randy Terbush
2010-03-24 5:54 ` Dan Williams
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=e9c3a7c21003231606s388d26e6gba266e6a44281973@mail.gmail.com \
--to=dan.j.williams@intel.com \
--cc=linux-raid@vger.kernel.org \
--cc=neilb@suse.de \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).