From: Jes Sorensen <Jes.Sorensen@redhat.com>
To: Tomasz Majchrzak <tomasz.majchrzak@intel.com>
Cc: linux-raid@vger.kernel.org
Subject: Re: [PATCH 1/4 v2] mdadm: bad block support for external metadata - initialization
Date: Mon, 28 Nov 2016 08:34:28 -0500 [thread overview]
Message-ID: <wrfjr35vpw2j.fsf@redhat.com> (raw)
In-Reply-To: <1477558425-13332-1-git-send-email-tomasz.majchrzak@intel.com> (Tomasz Majchrzak's message of "Thu, 27 Oct 2016 10:53:42 +0200")
Tomasz Majchrzak <tomasz.majchrzak@intel.com> writes:
> If metadata handler provides support for bad blocks, tell md by writing
> 'external_bbl' to rdev state file (both on create and assemble),
> followed by a list of known bad blocks written via sysfs 'bad_blocks'
> file.
>
> Signed-off-by: Tomasz Majchrzak <tomasz.majchrzak@intel.com>
> Reviewed-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
> ---
> mdadm.h | 13 +++++++++++++
> sysfs.c | 29 ++++++++++++++++++++++++++++-
> 2 files changed, 41 insertions(+), 1 deletion(-)
Hi Tomasz,
Most of this one looks fine, just one minor nit.
> diff --git a/mdadm.h b/mdadm.h
> index 0516c82..5156ea4 100755
> --- a/mdadm.h
> +++ b/mdadm.h
> @@ -237,6 +237,17 @@ struct dlm_lksb {
>
> extern const char Name[];
>
> +struct md_bb_entry {
> + unsigned long long sector;
> + int length;
> +};
> +
> +struct md_bb {
> + int supported;
> + int count;
> + struct md_bb_entry *entries;
> +};
> +
> /* general information that might be extracted from a superblock */
> struct mdinfo {
> mdu_array_info_t array;
> @@ -311,6 +322,8 @@ struct mdinfo {
>
> /* info read from sysfs */
> char sysfs_array_state[20];
> +
> + struct md_bb bb;
> };
>
> struct createinfo {
> diff --git a/sysfs.c b/sysfs.c
> index d28e21a..c7a8e66 100644
> --- a/sysfs.c
> +++ b/sysfs.c
> @@ -50,8 +50,12 @@ void sysfs_free(struct mdinfo *sra)
> while (sra->devs) {
> struct mdinfo *d = sra->devs;
> sra->devs = d->next;
> + if (d->bb.entries)
> + free(d->bb.entries);
> free(d);
> }
> + if (sra->bb.entries)
> + free(sra->bb.entries);
> free(sra);
> sra = sra2;
> }
free() handles NULL pointers, so no need to check first.
Cheers,
Jes
next prev parent reply other threads:[~2016-11-28 13:34 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-27 8:53 [PATCH 1/4 v2] mdadm: bad block support for external metadata - initialization Tomasz Majchrzak
2016-10-27 8:53 ` [PATCH 2/4 v2] mdmon: bad block support for external metadata - sysfs file open Tomasz Majchrzak
2016-11-28 22:46 ` Jes Sorensen
2016-10-27 8:53 ` [PATCH 3/4 v2] mdmon: bad block support for external metadata - store bad blocks Tomasz Majchrzak
2016-11-28 22:49 ` Jes Sorensen
2016-10-27 8:53 ` [PATCH 4/4 v4] mdmon: bad block support for external metadata - clear " Tomasz Majchrzak
2016-11-28 22:50 ` Jes Sorensen
2021-09-28 23:56 ` NeilBrown
2021-09-29 8:04 ` Tkaczyk, Mariusz
2016-11-24 14:01 ` [PATCH 1/4 v2] mdadm: bad block support for external metadata - initialization Tomasz Majchrzak
2016-11-24 15:53 ` Jes Sorensen
2016-11-28 13:43 ` Jes Sorensen
2016-11-28 13:34 ` Jes Sorensen [this message]
2016-11-28 14:07 ` [PATCH 1/4] " Tomasz Majchrzak
2016-11-28 22:45 ` Jes Sorensen
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=wrfjr35vpw2j.fsf@redhat.com \
--to=jes.sorensen@redhat.com \
--cc=linux-raid@vger.kernel.org \
--cc=tomasz.majchrzak@intel.com \
/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).