mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Randy.Dunlap" <rddunlap@osdl.org>
To: "Randy.Dunlap" <rddunlap@osdl.org>
Cc: akpm@osdl.org, linux-kernel@vger.kernel.org, zwane@linuxpower.ca,
	axboe@suse.de, arvidjaar@mail.ru, stoffel@lucent.com,
	barryn@pobox.com, torvalds@osdl.org
Subject: Re: [PATCH] floppy I/O error handling => Oops
Date: Sun, 21 Sep 2003 12:40:38 -0700	[thread overview]
Message-ID: <20030921124038.33e44375.rddunlap@osdl.org> (raw)
In-Reply-To: <20030921113930.4ce1f0a1.rddunlap@osdl.org>

On Sun, 21 Sep 2003 11:39:30 -0700 "Randy.Dunlap" <rddunlap@osdl.org> wrote:

| 
| bad_flp_intr() in floppy.c can cause an Oops if the I/O request is
| freed but <errors> still points into the I/O request block.
| 
| bad_flp_intr() oopsen reports:
| 
| Andrey: http://marc.theaimsgroup.com/?l=linux-kernel&m=105837886921297&w=2
| John:   http://marc.theaimsgroup.com/?l=linux-kernel&m=106303650007125&w=2
| Barry:  http://bugme.osdl.org/show_bug.cgi?id=1033

Here's an alternate patch.  Is it preferable?
Still works for me.

--
~Randy


patch_name:	flopio2_errors.patch
patch_version:	2003-09-21.12:26:38
author:		Randy.Dunlap <rddunlap@osdl.org>
description:	don't use <errors> pointer after calling cont->done();
		the request block can become invalid;
product:	Linux
product_versions: 2.6.0-test5
diffstat:	=
 drivers/block/floppy.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)


diff -Naur ./drivers/block/floppy.c~flopio ./drivers/block/floppy.c
--- ./drivers/block/floppy.c~flopio	2003-09-08 12:49:53.000000000 -0700
+++ ./drivers/block/floppy.c	2003-09-21 12:25:01.000000000 -0700
@@ -2152,18 +2152,20 @@
 
 static void bad_flp_intr(void)
 {
+	int errcount;
 	if (probing){
 		DRS->probed_format++;
 		if (!next_valid_format())
 			return;
 	}
 	(*errors)++;
+	errcount = *errors;
 	INFBOUND(DRWE->badness, *errors);
-	if (*errors > DP->max_errors.abort)
+	if (errcount > DP->max_errors.abort)
 		cont->done(0);
-	if (*errors > DP->max_errors.reset)
+	if (errcount > DP->max_errors.reset)
 		FDCS->reset = 1;
-	else if (*errors > DP->max_errors.recal)
+	else if (errcount > DP->max_errors.recal)
 		DRS->track = NEED_2_RECAL;
 }
 

      reply	other threads:[~2003-09-21 19:41 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-09-21 18:39 Randy.Dunlap
2003-09-21 19:40 ` Randy.Dunlap [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=20030921124038.33e44375.rddunlap@osdl.org \
    --to=rddunlap@osdl.org \
    --cc=akpm@osdl.org \
    --cc=arvidjaar@mail.ru \
    --cc=axboe@suse.de \
    --cc=barryn@pobox.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stoffel@lucent.com \
    --cc=torvalds@osdl.org \
    --cc=zwane@linuxpower.ca \
    /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®