linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] md/raid10: use correct limit variable
@ 2012-10-02  8:04 Dan Carpenter
  2012-10-03  1:51 ` NeilBrown
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2012-10-02  8:04 UTC (permalink / raw)
  To: Neil Brown; +Cc: linux-raid, kernel-janitors

Clang complains that we are assigning a variable to itself.  This should
be using bad_sectors like the similar earlier check does.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
index 56149ce..4448624 100644
--- a/drivers/md/raid10.c
+++ b/drivers/md/raid10.c
@@ -3219,7 +3219,7 @@ static sector_t sync_request(struct mddev *mddev, sector_t sector_nr,
 				else {
 					bad_sectors -= (sector - first_bad);
 					if (max_sync > bad_sectors)
-						max_sync = max_sync;
+						max_sync = bad_sectors;
 					continue;
 				}
 			}

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [patch] md/raid10: use correct limit variable
  2012-10-02  8:04 [patch] md/raid10: use correct limit variable Dan Carpenter
@ 2012-10-03  1:51 ` NeilBrown
  0 siblings, 0 replies; 2+ messages in thread
From: NeilBrown @ 2012-10-03  1:51 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: linux-raid, kernel-janitors

[-- Attachment #1: Type: text/plain, Size: 877 bytes --]

On Tue, 2 Oct 2012 11:04:22 +0300 Dan Carpenter <dan.carpenter@oracle.com>
wrote:

> Clang complains that we are assigning a variable to itself.  This should
> be using bad_sectors like the similar earlier check does.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> 
> diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
> index 56149ce..4448624 100644
> --- a/drivers/md/raid10.c
> +++ b/drivers/md/raid10.c
> @@ -3219,7 +3219,7 @@ static sector_t sync_request(struct mddev *mddev, sector_t sector_nr,
>  				else {
>  					bad_sectors -= (sector - first_bad);
>  					if (max_sync > bad_sectors)
> -						max_sync = max_sync;
> +						max_sync = bad_sectors;
>  					continue;
>  				}
>  			}

We sure do have some careless programmers around here :-(

That bug has been there since 3.1-rc1.

Thanks for finding it!

NeilBrown

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-10-03  1:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-02  8:04 [patch] md/raid10: use correct limit variable Dan Carpenter
2012-10-03  1:51 ` NeilBrown

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).