From: Christoph Hellwig <hch@ns.caldera.de>
To: joachim_weller@hsgmed.com (Joachim Weller)
Cc: JoachimWeller@web.de, linux-kernel@vger.kernel.org, axboe@suse.de
Subject: Re: BUG: cat /proc/partitions endless loop
Date: Fri, 28 Sep 2001 15:39:01 +0200 [thread overview]
Message-ID: <200109281339.f8SDd1A08841@ns.caldera.de> (raw)
In-Reply-To: <200109281315.f8SDFpA01669@bmdipc2c.germany.agilent.com>
In article <200109281315.f8SDFpA01669@bmdipc2c.germany.agilent.com> you wrote:
> I traced the problem down to drivers/block/genhd.c,
> where the function get_partition_list() outer loop does not
> terminate due to the last element in the structured list starting
> with gendisk_head is not initialized to NULL, by whatever reason.
> My fix does not cure the pointered endless loop, but prevents
> from looping when stepping thru the pointered list.
I think the fix could be simpler. What about:
--- ../master/linux-2.4.10/drivers/block/genhd.c Sun Sep 23 21:20:52 2001
+++ linux-2.4.10/drivers/block/genhd.c Fri Sep 28 15:34:14 2001
@@ -115,7 +115,7 @@
len = sprintf(page, "major minor #blocks name\n\n");
read_lock(&gendisk_lock);
- for (gp = gendisk_head; gp; gp = gp->next) {
+ for (gp = gendisk_head; gp != gendisk_head; gp = gp->next) {
for (n = 0; n < (gp->nr_real << gp->minor_shift); n++) {
if (gp->part[n].nr_sects == 0)
continue;
next prev parent reply other threads:[~2001-09-28 13:39 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-09-28 13:15 Joachim Weller
2001-09-28 13:39 ` Christoph Hellwig [this message]
2001-09-28 14:48 Joachim Weller
2001-09-28 15:00 ` Christoph Hellwig
2001-09-28 15:22 ` Joachim Weller
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=200109281339.f8SDd1A08841@ns.caldera.de \
--to=hch@ns.caldera.de \
--cc=JoachimWeller@web.de \
--cc=axboe@suse.de \
--cc=joachim_weller@hsgmed.com \
--cc=linux-kernel@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
all inboxes | Powered by JetHome®