From: Christoph Hellwig <hch@lst•de>
To: Arnd Bergmann <arnd@arndb•de>
Cc: Arnd Bergmann <arndbergmann@googlemail•com>,
Jonathan Corbet <corbet@lwn•net>,
Frederic Weisbecker <fweisbec@gmail•com>,
LKML <linux-kernel@vger•kernel.org>,
linuxppc-dev@ozlabs•org, John Kacur <jkacur@redhat•com>,
Thomas Gleixner <tglx@linutronix•de>, Ingo Molnar <mingo@elte•hu>,
Alan Cox <alan@lxorguk•ukuu.org.uk>
Subject: Re: [PATCH] macintosh: Explicitly set llseek to no_llseek in ans-lcd
Date: Mon, 16 Nov 2009 11:54:27 +0100 [thread overview]
Message-ID: <20091116105427.GA17411@lst.de> (raw)
In-Reply-To: <200911021651.53331.arnd@arndb.de>
On Mon, Nov 02, 2009 at 04:51:52PM +0100, Arnd Bergmann wrote:
> I looked at what places in the code manipulate file->f_pos directly
> and found that almost all the uses in driver code are broken because
> they don't take any locks. Most of them are in driver specific
> lseek operations. Others are in read/write methods and are even
> more broken because the change gets immediately overwritten by
> vfs_read/vfs_write when the driver method returns.
>
> IMHO, we should complete the pushdown into all ioctl methods
> that John and Thomas have started working on, fixing the lseek
> methods in those files we touch.
>
> When that is done, all interaction between default_llseek and
> driver locking has to be with explicit calls to lock_kernel
> in those drivers, so we can reasonably well script the search
> for drivers needing the BKL in llseek: everyhing that
> a) defines file_operations without an llseek function,
> b) touches f_pos somewhere, and
> c) calls lock_kernel() somewhere
> That should only be a small number and when they are fixed,
> we can remove default_llseek and instead call generic_file_llseek
> for any file operation without a separate llseek method.
As mentioned before making generic_file_llseek the new default is
probably a bad idea. The majority of our file_operations instances
don't actually support seeking, so no_llseek should become the new
default if you spend some effort on converting things. Anything that
wants to allow seeking will have to set a llseek method. This also
mirrors what we do for other file operations. None of the major ones
has a non-trivial default, it's either silently succeeding for a
selected few like open or release or returning an error for operatings
that actually do something like read and write.
next prev parent reply other threads:[~2009-11-16 11:05 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20091010153314.827301943@linutronix.de>
2009-10-10 15:37 ` [patch 22/28] macintosh: Remove BKL from ans-lcd Thomas Gleixner
2009-10-10 21:14 ` John Kacur
2009-10-10 23:13 ` Alan Cox
2009-10-10 23:27 ` John Kacur
2009-10-11 9:02 ` Benjamin Herrenschmidt
2009-10-21 21:07 ` [PATCH] macintosh: Explicitly set llseek to no_llseek in ans-lcd John Kacur
2009-10-21 21:21 ` Frederic Weisbecker
2009-10-21 21:33 ` John Kacur
2009-10-21 21:45 ` Frederic Weisbecker
2009-10-21 21:53 ` John Kacur
2009-10-21 22:16 ` Frederic Weisbecker
2009-11-02 15:51 ` Arnd Bergmann
2009-11-16 10:54 ` Christoph Hellwig [this message]
2009-11-16 12:09 ` Arnd Bergmann
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=20091116105427.GA17411@lst.de \
--to=hch@lst$(echo .)de \
--cc=alan@lxorguk$(echo .)ukuu.org.uk \
--cc=arnd@arndb$(echo .)de \
--cc=arndbergmann@googlemail$(echo .)com \
--cc=corbet@lwn$(echo .)net \
--cc=fweisbec@gmail$(echo .)com \
--cc=jkacur@redhat$(echo .)com \
--cc=linux-kernel@vger$(echo .)kernel.org \
--cc=linuxppc-dev@ozlabs$(echo .)org \
--cc=mingo@elte$(echo .)hu \
--cc=tglx@linutronix$(echo .)de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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