All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@suse.cz>
To: Paul Clements <paul.clements@steeleye.com>
Cc: kernel list <linux-kernel@vger.kernel.org>,
	Andrew Morton <akpm@osdl.org>
Subject: Re: nbd: add locking to nbd_ioctl
Date: Fri, 16 Jan 2009 16:36:03 +0100	[thread overview]
Message-ID: <20090116153603.GD2022@elf.ucw.cz> (raw)
In-Reply-To: <4970A696.9070307@steeleye.com>

On Fri 2009-01-16 10:24:06, Paul Clements wrote:
> Pavel Machek wrote:
>> The code was written with "oh big kernel lock, please protect me from
>> all the evil" mentality: it does not locks its own data structures, it
>> just hopes that big kernel lock somehow helps.
>>
>> It does not. (My fault).
>>
>> So this uses tx_lock to protect data structures from concurrent use
>> between ioctl and worker threads.
>
> What is the particular problem that this fixes? I thought we had already  
> been careful to take tx_lock where necessary to protect data structures.  
>   Perhaps there is something I missed?

for example lo->sock / lo->file are written to without holding any
lock in current code. (lo->xmit_timeout has similar problem, and other
fields, too).

I used tx_lock to protect those fields.
									Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

  reply	other threads:[~2009-01-16 15:34 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-16 11:55 nbd: add locking to nbd_ioctl Pavel Machek
2009-01-16 12:08 ` Pavel Machek
2009-01-16 12:29 ` Arnd Bergmann
2009-01-16 15:24 ` Paul Clements
2009-01-16 15:36   ` Pavel Machek [this message]
2009-01-16 16:28     ` Paul Clements
2009-01-19  9:54       ` Pavel Machek
2009-01-19 14:56         ` Paul Clements
2009-01-26 16:49           ` Pavel Machek
2009-01-26 17:01             ` Paul Clements
2009-01-26 17:32               ` Pavel Machek
  -- strict thread matches above, loose matches on Subject: below --
2009-01-26 17:31 Pavel Machek
2009-01-29  1:14 ` Andrew Morton
2009-01-29  1:18 ` Andrew Morton

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=20090116153603.GD2022@elf.ucw.cz \
    --to=pavel@suse.cz \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paul.clements@steeleye.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.