From: Andrew Price <andy@andrewprice.me.uk>
To: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Cc: Theodore Tso <tytso@mit.edu>, "Rafael J. Wysocki" <rjw@sisk.pl>,
linux-kernel@vger.kernel.org
Subject: Re: BUG: using rootfstype=ext4 causes oops
Date: Thu, 16 Apr 2009 18:05:56 +0100 [thread overview]
Message-ID: <20090416170556.GA24066@sucs.org> (raw)
In-Reply-To: <200904161802.21302.bzolnier@gmail.com>
On Thu, Apr 16, 2009 at 06:02:21PM +0200, Bartlomiej Zolnierkiewicz wrote:
> Freeing non-slab objects is bad.
>
> Andrew, does this patch help?
Yes, that seems to fix it. I tested it with gfs2 and ext4 the usual way
and I couldn't reproduce the panic.
Thanks Bartlomiej.
> ---
> drivers/ide/ide-io.c | 11 +++++++----
> 1 file changed, 7 insertions(+), 4 deletions(-)
>
> Index: b/drivers/ide/ide-io.c
> ===================================================================
> --- a/drivers/ide/ide-io.c
> +++ b/drivers/ide/ide-io.c
> @@ -102,11 +102,14 @@ void ide_complete_cmd(ide_drive_t *drive
> drive->dev_flags |= IDE_DFLAG_PARKED;
> }
>
> - if (rq && rq->cmd_type == REQ_TYPE_ATA_TASKFILE)
> - memcpy(rq->special, cmd, sizeof(*cmd));
> + if (rq && rq->cmd_type == REQ_TYPE_ATA_TASKFILE) {
> + struct ide_cmd *orig_cmd = rq->special;
>
> - if (cmd->tf_flags & IDE_TFLAG_DYN)
> - kfree(cmd);
> + if (cmd->tf_flags & IDE_TFLAG_DYN)
> + kfree(orig_cmd);
> + else
> + memcpy(orig_cmd, cmd, sizeof(*cmd));
> + }
> }
>
> /* obsolete, blk_rq_bytes() should be used instead */
>
--
Andrew Price
next prev parent reply other threads:[~2009-04-16 17:06 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-15 20:59 BUG: using rootfstype=ext4 causes oops Andrew Price
2009-04-16 4:19 ` Theodore Tso
2009-04-16 10:47 ` Andrew Price
2009-04-16 14:53 ` Theodore Tso
2009-04-16 16:02 ` Bartlomiej Zolnierkiewicz
2009-04-16 17:05 ` Andrew Price [this message]
2009-04-16 19:22 ` Bartlomiej Zolnierkiewicz
2009-04-16 16:38 ` Andrew Price
2009-04-16 16:55 ` Theodore Tso
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=20090416170556.GA24066@sucs.org \
--to=andy@andrewprice.me.uk \
--cc=bzolnier@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rjw@sisk.pl \
--cc=tytso@mit.edu \
/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