All of lore.kernel.org
 help / color / mirror / Atom feed
From: Douglas Gilbert <dougg@torque.net>
To: FUJITA Tomonori <tomof@acm.org>
Cc: linux-scsi@vger.kernel.org, James.Bottomley@SteelEye.com,
	jens.axboe@oracle.com, fujita.tomonori@lab.ntt.co.jp
Subject: Re: [PATCH] sg: increase sglist_len of the sg_scatter_hold structure
Date: Sun, 05 Aug 2007 12:55:16 -0400	[thread overview]
Message-ID: <46B600F4.7020601@torque.net> (raw)
In-Reply-To: <200708051531.l75FVnjP011717@mbox.iij4u.or.jp>

FUJITA Tomonori wrote:
> unsigned short is too small for sizeof(struct scatterlist) *
> min(q->max_hw_segments, q->max_phys_segments).
> 
> This fixes memory leak with 4096 segments since 16 (likely sg size
> with x86) * 4096 sets sglist_len to zero.
> 
> This might not happen without sg chaining support.
> 
> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
> ---
>  drivers/scsi/sg.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c
> index 2fc24e7..2c44bb0 100644
> --- a/drivers/scsi/sg.c
> +++ b/drivers/scsi/sg.c
> @@ -114,7 +114,7 @@ static struct class_interface sg_interface = {
>  
>  typedef struct sg_scatter_hold { /* holding area for scsi scatter gather info */
>  	unsigned short k_use_sg; /* Count of kernel scatter-gather pieces */
> -	unsigned short sglist_len; /* size of malloc'd scatter-gather list ++ */
> +	unsigned sglist_len; /* size of malloc'd scatter-gather list ++ */
>  	unsigned bufflen;	/* Size of (aggregate) data buffer */
>  	unsigned b_malloc_len;	/* actual len malloc'ed in buffer */
>  	struct scatterlist *buffer;/* scatter list */

Tomo,
Thanks.

Signed-off-by: Douglas Gilbert <dougg@torque.net>


  reply	other threads:[~2007-08-05 16:55 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-05 15:31 [PATCH] sg: increase sglist_len of the sg_scatter_hold structure FUJITA Tomonori
2007-08-05 16:55 ` Douglas Gilbert [this message]
2007-08-06  4:09   ` FUJITA Tomonori
2007-08-07 17:13     ` Mike Christie
2007-08-07 22:38       ` FUJITA Tomonori
2007-08-08  7:15         ` Jens Axboe
2007-08-08 16:58         ` Mike Christie
2007-08-08 17:20           ` Mike Christie
2007-08-09  7:33             ` Benny Halevy
2007-08-09 13:43             ` FUJITA Tomonori
2007-08-09 13:43           ` FUJITA Tomonori

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=46B600F4.7020601@torque.net \
    --to=dougg@torque.net \
    --cc=James.Bottomley@SteelEye.com \
    --cc=fujita.tomonori@lab.ntt.co.jp \
    --cc=jens.axboe@oracle.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=tomof@acm.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.