* [PATCH] md - 3 of 3 - Don't check a device size before bd_get in md.c
@ 2003-03-13 1:00 NeilBrown
2003-03-13 9:22 ` Lars Marowsky-Bree
0 siblings, 1 reply; 5+ messages in thread
From: NeilBrown @ 2003-03-13 1:00 UTC (permalink / raw)
To: Marcelo Tosatti; +Cc: linux-raid
Lars Marowsky-Bree <lmb@suse.de> noted that we shouldn't
be using blk_size for a device before calling bd_get.
This code rearrangement fixes this little issue.
----------- Diffstat output ------------
./drivers/md/md.c | 15 ++++++++-------
1 files changed, 8 insertions(+), 7 deletions(-)
diff ./drivers/md/md.c~current~ ./drivers/md/md.c
--- ./drivers/md/md.c~current~ 2003-03-13 10:47:13.000000000 +1100
+++ ./drivers/md/md.c 2003-03-13 11:46:25.000000000 +1100
@@ -2395,13 +2395,6 @@ static int hot_add_disk(mddev_t * mddev,
}
persistent = !mddev->sb->not_persistent;
- size = calc_dev_size(dev, mddev, persistent);
-
- if (size < mddev->sb->size) {
- printk(KERN_WARNING "md%d: disk size %d blocks < array size %d\n",
- mdidx(mddev), size, mddev->sb->size);
- return -ENOSPC;
- }
rdev = find_rdev(mddev, dev);
if (rdev)
@@ -2423,6 +2416,14 @@ static int hot_add_disk(mddev_t * mddev,
err = -EINVAL;
goto abort_export;
}
+ size = calc_dev_size(dev, mddev, persistent);
+
+ if (size < mddev->sb->size) {
+ printk(KERN_WARNING "md%d: disk size %d blocks < array size %d\n",
+ mdidx(mddev), size, mddev->sb->size);
+ err = -ENOSPC;
+ gotot abort_export;
+ }
bind_rdev_to_array(rdev, mddev);
/*
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] md - 3 of 3 - Don't check a device size before bd_get in md.c
2003-03-13 1:00 [PATCH] md - 3 of 3 - Don't check a device size before bd_get in md.c NeilBrown
@ 2003-03-13 9:22 ` Lars Marowsky-Bree
2003-03-13 9:38 ` Neil Brown
0 siblings, 1 reply; 5+ messages in thread
From: Lars Marowsky-Bree @ 2003-03-13 9:22 UTC (permalink / raw)
To: NeilBrown, Marcelo Tosatti; +Cc: linux-raid
On 2003-03-13T12:00:10,
NeilBrown <neilb@cse.unsw.edu.au> said:
> Lars Marowsky-Bree <lmb@suse.de> noted that we shouldn't
> be using blk_size for a device before calling bd_get.
> This code rearrangement fixes this little issue.
>
>
> ----------- Diffstat output ------------
> ./drivers/md/md.c | 15 ++++++++-------
> 1 files changed, 8 insertions(+), 7 deletions(-)
>
> diff ./drivers/md/md.c~current~ ./drivers/md/md.c
> --- ./drivers/md/md.c~current~ 2003-03-13 10:47:13.000000000 +1100
> +++ ./drivers/md/md.c 2003-03-13 11:46:25.000000000 +1100
> @@ -2395,13 +2395,6 @@ static int hot_add_disk(mddev_t * mddev,
> }
>
> persistent = !mddev->sb->not_persistent;
> - size = calc_dev_size(dev, mddev, persistent);
> -
> - if (size < mddev->sb->size) {
> - printk(KERN_WARNING "md%d: disk size %d blocks < array size %d\n",
> - mdidx(mddev), size, mddev->sb->size);
> - return -ENOSPC;
> - }
>
> rdev = find_rdev(mddev, dev);
> if (rdev)
> @@ -2423,6 +2416,14 @@ static int hot_add_disk(mddev_t * mddev,
> err = -EINVAL;
> goto abort_export;
> }
> + size = calc_dev_size(dev, mddev, persistent);
> +
> + if (size < mddev->sb->size) {
> + printk(KERN_WARNING "md%d: disk size %d blocks < array size %d\n",
> + mdidx(mddev), size, mddev->sb->size);
> + err = -ENOSPC;
> + gotot abort_export;
Hi Neil, the patch seems to have gotten mangled here, I'm reasonably sure
"gotot" won't compile at least ;-)
Sincerely,
Lars Marowsky-Brée <lmb@suse.de>
--
Principal Squirrel
SuSE Labs - Research & Development, SuSE Linux AG
"If anything can go wrong, it will." "Chance favors the prepared (mind)."
-- Capt. Edward A. Murphy -- Louis Pasteur
-
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] md - 3 of 3 - Don't check a device size before bd_get in md.c
2003-03-13 9:22 ` Lars Marowsky-Bree
@ 2003-03-13 9:38 ` Neil Brown
2003-03-19 19:13 ` Marcelo Tosatti
0 siblings, 1 reply; 5+ messages in thread
From: Neil Brown @ 2003-03-13 9:38 UTC (permalink / raw)
To: Lars Marowsky-Bree; +Cc: Marcelo Tosatti, linux-raid
On Thursday March 13, lmb@suse.de wrote:
>
> Hi Neil, the patch seems to have gotten mangled here, I'm reasonably sure
> "gotot" won't compile at least ;-)
>
Hmmm. that's very odd. I was sure I compiled it to test all the
patches.... Maybe a stray keystroke got in before I commited it.
Anyway I will wait to see what appears in marcelo's tree and then send
whatever is appropriate.
Thanks,
NeilBrown
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] md - 3 of 3 - Don't check a device size before bd_get in md.c
2003-03-13 9:38 ` Neil Brown
@ 2003-03-19 19:13 ` Marcelo Tosatti
2003-03-19 23:37 ` Neil Brown
0 siblings, 1 reply; 5+ messages in thread
From: Marcelo Tosatti @ 2003-03-19 19:13 UTC (permalink / raw)
To: Neil Brown; +Cc: Lars Marowsky-Bree, linux-raid
Its already on my tree.
On Thu, 13 Mar 2003, Neil Brown wrote:
> On Thursday March 13, lmb@suse.de wrote:
> >
> > Hi Neil, the patch seems to have gotten mangled here, I'm reasonably sure
> > "gotot" won't compile at least ;-)
> >
>
> Hmmm. that's very odd. I was sure I compiled it to test all the
> patches.... Maybe a stray keystroke got in before I commited it.
> Anyway I will wait to see what appears in marcelo's tree and then send
> whatever is appropriate.
>
> Thanks,
> NeilBrown
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] md - 3 of 3 - Don't check a device size before bd_get in md.c
2003-03-19 19:13 ` Marcelo Tosatti
@ 2003-03-19 23:37 ` Neil Brown
0 siblings, 0 replies; 5+ messages in thread
From: Neil Brown @ 2003-03-19 23:37 UTC (permalink / raw)
To: Marcelo Tosatti; +Cc: Lars Marowsky-Bree, linux-raid
On Wednesday March 19, marcelo@conectiva.com.br wrote:
>
> Its already on my tree.
Great. This will fix it up.
Thanks.
NeilBrown
Fix compile errors/warnings in md
----------- Diffstat output ------------
./drivers/md/md.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff ./drivers/md/md.c~current~ ./drivers/md/md.c
--- ./drivers/md/md.c~current~ 2003-03-20 09:58:02.000000000 +1100
+++ ./drivers/md/md.c 2003-03-20 10:33:04.000000000 +1100
@@ -2422,7 +2422,7 @@ static int hot_add_disk(mddev_t * mddev,
printk(KERN_WARNING "md%d: disk size %d blocks < array size %d\n",
mdidx(mddev), size, mddev->sb->size);
err = -ENOSPC;
- gotot abort_export;
+ goto abort_export;
}
bind_rdev_to_array(rdev, mddev);
@@ -3066,7 +3066,7 @@ int md_error(mddev_t *mddev, kdev_t rdev
return 0;
}
-static int status_unused(struct seq_file *seq)
+static void status_unused(struct seq_file *seq)
{
int i = 0;
mdk_rdev_t *rdev;
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2003-03-19 23:37 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-03-13 1:00 [PATCH] md - 3 of 3 - Don't check a device size before bd_get in md.c NeilBrown
2003-03-13 9:22 ` Lars Marowsky-Bree
2003-03-13 9:38 ` Neil Brown
2003-03-19 19:13 ` Marcelo Tosatti
2003-03-19 23:37 ` Neil Brown
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.