All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kai Makisara <Kai.Makisara@kolumbus.fi>
To: Arnd Bergmann <arnd@arndb.de>
Cc: dgilbert@interlog.com, Jens Axboe <axboe@kernel.dk>,
	Vivek Goyal <vgoyal@redhat.com>, Tejun Heo <tj@kernel.org>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>,
	"Martin K. Petersen" <martin.petersen@oracle.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Ingo Molnar <mingo@redhat.com>, John Kacur <jkacur@redhat.com>,
	linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] [RFC] block: replace BKL with global mutex
Date: Thu, 15 Apr 2010 23:03:24 +0300 (EEST)	[thread overview]
Message-ID: <alpine.LNX.2.00.1004152244160.5127@kai.makisara.local> (raw)
In-Reply-To: <201004151629.45029.arnd@arndb.de>

On Thu, 15 Apr 2010, Arnd Bergmann wrote:

> On Thursday 15 April 2010, Douglas Gilbert wrote:
> > At the level of SCSI commands, tape device state assumptions
> > made by the st driver could be compromised by SCSI commands
> > sent by the sg driver. However the BKL was never meant
> > to address that concern.
> > 
...
> > So I would not be concerned about any kernel locking
> > interactions between the sg and st drivers. I have
> > added Kai Makisara (st maintainer) to the cc list.
> 
> Ok. I've also checked st.c again and noticed that it
> doesn't use use the BKL in ioctl() but only in open(),
> which is very unlikely to race against anything in sg.c
> or the block subsystem.
> 
Using sg with a tape opened by st may lead to incorrect state within st. 
However, to prevent this would be far too complicated and so the 
coordination responsibility is left to the user. (There are some 
cases where use of both sg and st can be justified but then the user 
should know what he/she is doing and properly serialize access in user 
space.)

BKL does not have any "hidden duties" in open() in st.c. I don't know any 
reason why it would be needed, but, because I have not been absolutely 
sure, I have not removed it. (The tape devices are not opened often and so 
the overhead has been negligible. That is, while BKL has been available.) 
If you don't see any reason for BKL in open(), go ahead and remove it.

Kai


  reply	other threads:[~2010-04-15 20:11 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-14 20:36 [PATCH 1/2] [RFC] block: replace BKL with global mutex Arnd Bergmann
2010-04-14 20:36 ` Arnd Bergmann
2010-04-14 20:36 ` [PATCH 2/2] [RFC] Remove BKL from fs/locks.c Arnd Bergmann
2010-04-14 20:52   ` Trond Myklebust
2010-04-14 21:04     ` J. Bruce Fields
2010-04-15 20:36       ` Arnd Bergmann
2010-04-15  4:14   ` Brad Boyer
2010-04-15 14:48   ` Steven Whitehouse
2010-04-15 15:17     ` Arnd Bergmann
2010-04-14 22:48 ` [PATCH 1/2] [RFC] block: replace BKL with global mutex Douglas Gilbert
2010-04-15  7:11   ` Arnd Bergmann
2010-04-15 13:15     ` Douglas Gilbert
2010-04-15 14:29       ` Arnd Bergmann
2010-04-15 20:03         ` Kai Makisara [this message]
2010-04-15 20:51           ` [PATCH] scsi/st: remove BKL from open Arnd Bergmann
2010-04-30  2:18             ` Frederic Weisbecker
2010-04-30 19:03               ` Kai Makisara

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=alpine.LNX.2.00.1004152244160.5127@kai.makisara.local \
    --to=kai.makisara@kolumbus.fi \
    --cc=arnd@arndb.de \
    --cc=axboe@kernel.dk \
    --cc=dgilbert@interlog.com \
    --cc=fujita.tomonori@lab.ntt.co.jp \
    --cc=fweisbec@gmail.com \
    --cc=jkacur@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=mingo@redhat.com \
    --cc=rostedt@goodmis.org \
    --cc=tj@kernel.org \
    --cc=vgoyal@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.