[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20090416170556.GA24066@sucs.org>
Date: Thu, 16 Apr 2009 18:05:56 +0100
From: Andrew Price <andy@...rewprice.me.uk>
To: Bartlomiej Zolnierkiewicz <bzolnier@...il.com>
Cc: Theodore Tso <tytso@....edu>, "Rafael J. Wysocki" <rjw@...k.pl>,
linux-kernel@...r.kernel.org
Subject: Re: BUG: using rootfstype=ext4 causes oops
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists