From: Douglas Gilbert <dougg@torque.net>
To: Mike Christie <michaelc@cs.wisc.edu>
Cc: linux-scsi@vger.kernel.org
Subject: Re: [PATCH] fix sg leak when scsi_execute_async fails
Date: Wed, 22 Mar 2006 18:10:45 -0500 [thread overview]
Message-ID: <4421D975.50100@torque.net> (raw)
In-Reply-To: <1143065078.2650.3.camel@max>
Mike Christie wrote:
> Doug found a bug where if scsi_execute_async fails, we are leaking
> sg resources. scsi_do_req never failed so we did not have to handle
> that case before.
When a SCSI command request falls foul of the extra
requirements in lk 2.6.16 (e.g. max_sectors), the
resulting ENOMEM leaves unfinished business in
the sg driver's own data structures. This can be
seen with 'cat /proc/scs/sg/debug' .
> Patch was made against scsi-misc. Not sure if this should
> also go to stable?
I think it should. It fixes a bug on an error
path by adding the same cleanup call as found
on other paths.
> Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: Douglas Gilbert <dougg@torque.net>
Doug Gilbert
> diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c
> index a8b05ce..71994ea 100644
> --- a/drivers/scsi/sg.c
> +++ b/drivers/scsi/sg.c
> @@ -748,6 +748,7 @@ sg_common_write(Sg_fd * sfp, Sg_request
> /*
> * most likely out of mem, but could also be a bad map
> */
> + sg_finish_rem_req(srp);
> return -ENOMEM;
> } else
> return 0;
>
>
prev parent reply other threads:[~2006-03-22 23:11 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-03-22 22:04 [PATCH] fix sg leak when scsi_execute_async fails Mike Christie
2006-03-22 23:10 ` Douglas Gilbert [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=4421D975.50100@torque.net \
--to=dougg@torque.net \
--cc=linux-scsi@vger.kernel.org \
--cc=michaelc@cs.wisc.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 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.