From: Andreas Dilger <adilger@turbolinux.com>
To: Neil Brown <neilb@cse.unsw.edu.au>
Cc: Linus Torvalds <torvalds@transmeta.com>,
V Ganesh <ganesh@veritas.com>,
linux-kernel@vger.kernel.org, linux-LVM@sistina.com,
mingo@redhat.com
Subject: Re: [PATCH] Re: [bug] infinite loop in generic_make_request()
Date: Thu, 30 Nov 2000 13:05:53 -0700 (MST) [thread overview]
Message-ID: <200011302005.eAUK5re01932@webber.adilger.net> (raw)
In-Reply-To: <14886.7367.247491.267120@notabene.cse.unsw.edu.au> "from Neil Brown at Nov 30, 2000 08:24:23 pm"
Neil Brown write:
> On Thursday November 30, ganesh@veritas.com wrote:
> > in generic_make_request(), the following code handles stacking:
> >
> > do {
> > q = blk_get_queue(bh->b_rdev);
> > if (!q) {
> > printk(...)
> > buffer_IO_error(bh);
> > break;
> > }
> > } while (q->make_request_fn(q, rw, bh));
> >
> > however, make_request_fn may return -1 in case of errors. one such fn is
> > raid0_make_request(). this causes generic_make_request() to loop endlessly.
> > lvm returns 1 unconditionally, so it would also loop if an error occured in
> > lvm_map(). other bdevs might have the same problem.
> > I think a better mechanism would be to mandate that make_request_fn ought
> > to call bh->b_end_io() in case of errors and return 0.
>
> Good catch, thanks. Below is a patch to fix md drivers (md.c,
> linear.c and raid0.c).
>
> NeilBrown
You need to also patch the lvm.c driver at the same time... However, this
change now makes it very counter-intuitive compared to other kernel
functions. Normally, we return 0 on success, and -ve on error. Maybe
the RAID and LVM make_request functions should be changed to do that
instead (i.e. 0 on success, -ve on error, and maybe "1" if they do their
own recursion to break the loop)?
Cheers, Andreas
PS - I fixed the LVM mailing list address...
--
Andreas Dilger \ "If a man ate a pound of pasta and a pound of antipasto,
\ would they cancel out, leaving him still hungry?"
http://www-mddsp.enel.ucalgary.ca/People/adilger/ -- Dogbert
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/
next prev parent reply other threads:[~2000-11-30 20:37 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-11-30 7:02 V Ganesh
2000-11-30 9:24 ` [PATCH] " Neil Brown
2000-11-30 20:05 ` Andreas Dilger [this message]
2000-11-30 20:41 ` Andrea Arcangeli
2000-11-30 21:54 ` Andreas Dilger
2000-11-30 22:17 ` Andrea Arcangeli
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=200011302005.eAUK5re01932@webber.adilger.net \
--to=adilger@turbolinux.com \
--cc=ganesh@veritas.com \
--cc=linux-LVM@sistina.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=neilb@cse.unsw.edu.au \
--cc=torvalds@transmeta.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
all inboxes | Powered by JetHome®