[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20090116153603.GD2022@elf.ucw.cz>
Date: Fri, 16 Jan 2009 16:36:03 +0100
From: Pavel Machek <pavel@...e.cz>
To: Paul Clements <paul.clements@...eleye.com>
Cc: kernel list <linux-kernel@...r.kernel.org>,
Andrew Morton <akpm@...l.org>
Subject: Re: nbd: add locking to nbd_ioctl
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists