From: NeilBrown <neilb@suse.de>
To: kedacomkernel <kedacomkernel@gmail.com>
Cc: linux-raid <linux-raid@vger.kernel.org>
Subject: Re: md:Add judgement bb->unacked_exist in function
Date: Wed, 14 Mar 2012 12:53:58 +1100 [thread overview]
Message-ID: <20120314125358.7c5e8f66@notabene.brown> (raw)
In-Reply-To: <201203081737420934967@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1575 bytes --]
On Thu, 8 Mar 2012 17:37:45 +0800 "kedacomkernel" <kedacomkernel@gmail.com>
wrote:
> >From 7054a9dcd23a721e3c3dd2ceb8f1243187ea5cc4 Mon Sep 17 00:00:00 2001
> From: majianpeng <majianpeng@gmail.com>
> Date: Thu, 8 Mar 2012 17:31:32 +0800
> Subject: [PATCH] md:Add judgement bb->unacked_exist in function
> md_ack_all_badblocks().
>
>
> Signed-off-by: majianpeng <majianpeng@gmail.com>
> ---
> drivers/md/md.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/md/md.c b/drivers/md/md.c
> index ce88755..7c57d0f 100644
> --- a/drivers/md/md.c
> +++ b/drivers/md/md.c
> @@ -8040,7 +8040,7 @@ void md_ack_all_badblocks(struct badblocks *bb)
> return;
> write_seqlock_irq(&bb->lock);
>
> - if (bb->changed == 0) {
> + if (bb->changed == 0 && bb->unacked_exist) {
> u64 *p = bb->page;
> int i;
> for (i = 0; i < bb->count ; i++) {
Thanks.
This is fairly minor optimisation as 'unacked_exists' it almost always true
when ->change is set, but I doesn't hurt so I've included it.
In general I prefer a slightly more details commit comment. It doesn't have
to be long, but it should make it obvious why the change is needed and what
it does.
I have made it:
md: Add judgement bb->unacked_exist in function md_ack_all_badblocks().
If there are no unacked bad blocks, then there is no point searching
for them to acknowledge them.
Signed-off-by: majianpeng <majianpeng@gmail.com>
Signed-off-by: NeilBrown <neilb@suse.de>
Thanks,
NeilBrown
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 828 bytes --]
prev parent reply other threads:[~2012-03-14 1:53 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-08 9:37 md:Add judgement bb->unacked_exist in function kedacomkernel
2012-03-14 1:53 ` NeilBrown [this message]
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=20120314125358.7c5e8f66@notabene.brown \
--to=neilb@suse.de \
--cc=kedacomkernel@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 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).