linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Jan Blunck <jblunck@suse.de>
Cc: linux-fsdevel@vger.kernel.org
Subject: Re: [RFC 3/3] BKL: Remove default_llseek()
Date: Thu, 1 Oct 2009 14:06:29 -0400	[thread overview]
Message-ID: <20091001180629.GB22497@infradead.org> (raw)
In-Reply-To: <1254324604-20243-4-git-send-email-jblunck@suse.de>

On Wed, Sep 30, 2009 at 05:30:04PM +0200, Jan Blunck wrote:
> default_llseek() is using the big kernel lock. There are only two users of
> that function that can both can be converted to use generic_file_llseek(). So
> get rid of default_llseek() completely.

I don't think it's that easy.  The are two crucial differences between
generic_file_llseek and default_llseek:

 - default_llseek uses the BKL for locking, and generic_file_llseek uses
   i_mutex
 - generic_file_llseek checks inode->i_sb->s_maxbytes and default_llseek
   doesn't.

The first could cause tons of problems, although it most likely doesn't.
The second is much nastier.  There are lots of non-regular file objects
residing on filesystems.  For character devices or synthetics files
the pagecache limitation doesn't make any sense at all and I'm pretty
sure it will break things.  For directories it might or might now
although in general we really need i_mutex in directories to protect
against namespace operations.

The only way to get rid of default_llseek is to audit all
file_operations instances, and make sure they all have a lssek method
that makes sense or call nonseekable_open during open to make sure
we error out early in in vfs_llseek.  This taks could be split
by e.g. taking care of character devices first, or files on procfs.

      reply	other threads:[~2009-10-01 18:06 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-30 15:30 [RFC 0/3] Remove BKL from fs/ Jan Blunck
2009-09-30 15:30 ` [RFC 1/3] BKL pushdown from do_new_mount() to the filesystems Jan Blunck
2009-09-30 15:46   ` Matthew Wilcox
2009-10-01 18:05     ` Jan Blunck
2009-10-08 15:49   ` Boaz Harrosh
2009-10-31 12:26     ` Jan Blunck
2009-09-30 15:30 ` [RFC 2/3] BKL: remove from ext2 Jan Blunck
2009-10-01 18:01   ` Christoph Hellwig
2009-10-31 12:24     ` Jan Blunck
2009-10-07  5:44   ` Andi Kleen
2009-09-30 15:30 ` [RFC 3/3] BKL: Remove default_llseek() Jan Blunck
2009-10-01 18:06   ` Christoph Hellwig [this message]

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=20091001180629.GB22497@infradead.org \
    --to=hch@infradead.org \
    --cc=jblunck@suse.de \
    --cc=linux-fsdevel@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).