From: Jens Axboe <jens.axboe@oracle.com>
To: Anton Blanchard <anton@samba.org>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Initialise scatter/gather list in sg driver
Date: Fri, 26 Oct 2007 13:59:58 +0200 [thread overview]
Message-ID: <20071026115958.GK5155@kernel.dk> (raw)
In-Reply-To: <20071025193530.GB20459@kryten>
On Thu, Oct 25 2007, Anton Blanchard wrote:
>
> After turning on DEBUG_SG I hit a fail:
>
> kernel BUG at include/linux/scatterlist.h:50!
>
> sg_build_indirect
> sg_build_reserve
> sg_open
> chrdev_open
> __dentry_open
> do_filp_open
> do_sys_open
>
> We should initialise the sg list when we allocate it in sg_build_sgat.
>
> Signed-off-by: Anton Blanchard <anton@samba.org>
> ---
>
> diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c
> index b5fa4f0..f1871ea 100644
> --- a/drivers/scsi/sg.c
> +++ b/drivers/scsi/sg.c
> @@ -1652,6 +1652,7 @@ sg_build_sgat(Sg_scatter_hold * schp, const Sg_fd * sfp, int tablesize)
> schp->buffer = kzalloc(sg_bufflen, gfp_flags);
> if (!schp->buffer)
> return -ENOMEM;
> + sg_init_table(schp->buffer, tablesize);
> schp->sglist_len = sg_bufflen;
> return tablesize; /* number of scat_gath elements allocated */
> }
Thanks, applied!
--
Jens Axboe
next prev parent reply other threads:[~2007-10-26 12:02 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-25 19:35 [PATCH] Initialise scatter/gather list in sg driver Anton Blanchard
2007-10-26 11:59 ` Jens Axboe [this message]
-- strict thread matches above, loose matches on Subject: below --
2007-10-25 19:29 Anton Blanchard
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=20071026115958.GK5155@kernel.dk \
--to=jens.axboe@oracle.com \
--cc=anton@samba.org \
--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