From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: Russ Gorby <russ.gorby@intel.com>
Cc: Greg Kroah-Hartman <gregkh@suse.de>,
linux-kernel@vger.kernel.org, suhail.ahmed@intel.com
Subject: Re: [PATCH 2/2] tty: n_gsm: Added refcount usage to gsm_mux and gsm_dlci structs
Date: Mon, 20 Jun 2011 11:54:41 +0100 [thread overview]
Message-ID: <20110620115441.48d3544a@lxorguk.ukuu.org.uk> (raw)
In-Reply-To: <1308259213-31887-3-git-send-email-russ.gorby@intel.com>
On Thu, 16 Jun 2011 14:20:13 -0700
Russ Gorby <russ.gorby@intel.com> wrote:
> The gsm_mux is created/destroyed when ldisc is
> opened/closed but clients of the MUX channel devices (gsmttyN)
> may access this structure as long as the TTYs are open.
> For the open, the ldisc open is guaranteed to preceed the TTY open,
> but the close has no such guaranteed ordering. As a result,
> the gsm_mux can be freed in the ldisc close before being accessed
> by one of the TTY clients. This can happen if the ldisc is removed
> while there are open, active MUX channels.
> A similar situation exists for DLCI-0, it is basically a resource
> shared by MUX and DLCI , and should not be freed while they can
> be accessed
>
> To avoid this, gsm_mux and dlcis now have a reference counter
> ldisc open takes a reference on the mux and all the dlcis
> gsmtty_open takes a reference on the mux, dlci0 and its specific
> dlci. Dropping the last reference initiates the actual free.
>
> Signed-off-by: Russ Gorby <russ.gorby@intel.com>
Both Acked-by: Alan Cox <alan@linux.intel.com>
There are some possible bits of tidying up but they can be dealt with in
the future.
prev parent reply other threads:[~2011-06-20 10:52 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <[PATCH 0/2] N_GSM: RAW_IP Support : June 16, 2011>
2011-06-16 21:20 ` [PATCH 0/2] N_GSM: RAW_IP Support : June 16, 2011 Russ Gorby
2011-06-16 21:20 ` [PATCH 1/2] tty: n_gsm: Add raw-ip support Russ Gorby
2011-06-16 21:20 ` [PATCH 2/2] tty: n_gsm: Added refcount usage to gsm_mux and gsm_dlci structs Russ Gorby
2011-06-20 10:54 ` Alan Cox [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=20110620115441.48d3544a@lxorguk.ukuu.org.uk \
--to=alan@lxorguk.ukuu.org.uk \
--cc=gregkh@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=russ.gorby@intel.com \
--cc=suhail.ahmed@intel.com \
/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
all inboxes | Powered by JetHome®