All of lore.kernel.org
 help / color / mirror / Atom feed
From: Willy Tarreau <w@1wt.eu>
To: vitalivanov@gmail.com
Cc: Pete Zaitcev <zaitcev@redhat.com>,
	linux-usb-devel@lists.sourceforge.net,
	linux-kernel@vger.kernel.org
Subject: Re: [2.4 patch] Port of adutux driver from 2.6 kernel to 2.4.
Date: Sun, 4 Nov 2007 15:05:52 +0100	[thread overview]
Message-ID: <20071104140552.GA25915@1wt.eu> (raw)
In-Reply-To: <20071022204539.d3e1d291.zaitcev@redhat.com>

On Mon, Oct 22, 2007 at 08:45:39PM -0700, Pete Zaitcev wrote:
> On Fri, 19 Oct 2007 20:40:35 +0300, Vitaliy Ivanov <vitalivanov@gmail.com> wrote:
> 
> Hi, Vitaly, I added you on cc: for the 2.6 cleanup. Please double-check
> what I'm doing there and use it for your 2.4 version. I hope my intentions
> get clearer with an example. Now, about the specific question:
> 
> > Static lock minor_table_mutex is used for minor table structure.
> > And dev->sem for dev manipulations and that's why for open_count.
> > If you will simply browse /drivers/usb dir for 2.4 you will see that
> > such approach is widely used there.
> > What's not right?
> 
> The fundamental reason why you cannot lock a free-able structure with
> an in-structure lock is this. Imagine thread A locks in order to process
> a disconnect. Thread B wants to open and waits for the lock. Notice that
> the struct is not open, so thread A frees it. At this point, thread B
> is using a freed memory.
> 
> The solution is to lock the instance struct dev with dev->mtx, except
> for the open count, which is locked by a static lock (I'm ignoring
> interrupts here, which cannot use mutexes).
> 
> I'm sorry to say, you're quite right: a number of drivers in 2.4 got
> it wrong, and some (like adutux) carried it through 2.6.23.

Vitaly,

I'm planning on issuing a new 2.4.36 prerelease soon. Have you made any
progress on your code after Pete's recommendations ?

Thanks,
Willy


  reply	other threads:[~2007-11-04 14:06 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-14 17:37 [2.4 patch] Port of adutux driver from 2.6 kernel to 2.4 Vitaliy Ivanov
2007-10-14 18:25 ` Willy Tarreau
2007-10-14 20:45   ` Vitaliy Ivanov
2007-10-14 22:39     ` Willy Tarreau
2007-10-16 13:54       ` Vitaliy Ivanov
2007-10-16 15:41         ` Willy Tarreau
2007-10-16 17:56           ` Pete Zaitcev
2007-10-16 18:22             ` Vitaliy Ivanov
2007-10-16 18:24             ` Willy Tarreau
2007-10-16 18:24           ` Vitaliy Ivanov
2007-10-17 18:12             ` Vitaliy Ivanov
2007-10-19 15:26               ` Vitaliy Ivanov
2007-10-19 16:53                 ` Pete Zaitcev
2007-10-19 17:40                   ` Vitaliy Ivanov
2007-10-23  3:45                     ` Pete Zaitcev
2007-11-04 14:05                       ` Willy Tarreau [this message]
2007-11-05  9:32                         ` Vitaliy Ivanov
2007-11-05  9:36                           ` Willy Tarreau
2007-10-16 17:52         ` Pete Zaitcev
2007-10-15 17:30     ` Pete Zaitcev
2007-10-15 20:04       ` Vitaliy Ivanov
2007-10-16 13:48       ` Vitaliy Ivanov
2007-10-16 14:59         ` Greg KH

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=20071104140552.GA25915@1wt.eu \
    --to=w@1wt.eu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb-devel@lists.sourceforge.net \
    --cc=vitalivanov@gmail.com \
    --cc=zaitcev@redhat.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 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.