From: Al Viro <viro@ftp.linux.org.uk>
To: Miklos Szeredi <miklos@szeredi.hu>
Cc: greg@kroah.com, neilb@suse.de, green@linuxhacker.ru,
linux-fsdevel@vger.kernel.org
Subject: Re: FS-specified FSID for non-device based filesystems?
Date: Thu, 20 Apr 2006 13:30:06 +0100 [thread overview]
Message-ID: <20060420123006.GX27946@ftp.linux.org.uk> (raw)
In-Reply-To: <E1FWXo3-00043s-00@dorka.pomaz.szeredi.hu>
On Thu, Apr 20, 2006 at 01:58:43PM +0200, Miklos Szeredi wrote:
> > Speaking of obvious holes, what is
> > /* Setting file->private_data can't race with other mount()
> > instances, since BKL is held for ->get_sb() */
> > if (file->private_data)
> > return -EINVAL;
> > doing, seeing that the next thing you do is GFP_KERNEL allocations, which
> > would kill all hope to use BKL-based protection here?
>
> Why? I didn't know BKL is incompatible with allocations.
BKL is dropped when you give up CPU. It is reacquired when you get scheduled
again. It's not a mutex; it's not a spinlock. The right way to look at it
is the following:
* task has dumbness counter; lock_kernel() increments it,
unlock_kernel() decrements.
* at most one dumb task can have CPU at any given time
* dumb tasks are not preempted
That's it. You are only protected against other dumb tasks and *only* as long
as you don't block. Blocking won't make you any less dumb, so the same
warranties resume once you do get CPU again. However, anything might have
happened while you were blocked.
On UP boxen with PREEMPT disabled it's simply a no-op - it's all about
emulating that situation.
next prev parent reply other threads:[~2006-04-20 12:30 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-04-12 11:10 FS-specified FSID for non-device based filesystems? Oleg Drokin
2006-04-14 20:22 ` Bryan Henderson
2006-04-14 20:45 ` Oleg Drokin
2006-04-14 20:59 ` J. Bruce Fields
2006-04-14 21:32 ` Bryan Henderson
2006-04-14 21:41 ` Oleg Drokin
2006-04-17 0:54 ` Neil Brown
2006-04-17 3:50 ` Greg KH
2006-04-17 4:32 ` Neil Brown
2006-04-18 18:07 ` Greg KH
2006-04-19 12:15 ` Miklos Szeredi
2006-04-20 11:35 ` Al Viro
2006-04-20 11:58 ` Miklos Szeredi
2006-04-20 12:30 ` Al Viro [this message]
2006-04-20 12:43 ` Miklos Szeredi
2006-04-17 8:00 ` Anton Altaparmakov
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=20060420123006.GX27946@ftp.linux.org.uk \
--to=viro@ftp.linux.org.uk \
--cc=green@linuxhacker.ru \
--cc=greg@kroah.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=miklos@szeredi.hu \
--cc=neilb@suse.de \
/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