Messages in this thread | | | Date | Wed, 21 Oct 2009 22:55:14 -0400 | From | Christoph Hellwig <> | Subject | Re: [PATCH] sony_pi: Remove the BKL from sonypi_misc_open |
| |
On Wed, Oct 21, 2009 at 11:31:42PM +0200, Frederic Weisbecker wrote: > What about a pusdown of default_lseek attribution for these > fops that don't have any llseek() (and rename it to > deprecated_default_lseek() ) > > Because we can probably fix these fops one by one but what > about the next drivers that will have no llseek() ? > > We can't attribute default_llseek() by default anymore for > further fops that are to come.
The right (although quite complicated) thing is to return -ESPIPE from vfs_llseek if no ->llseek method is present, or even better also disallowing pread/pwrite by default. It'll need a quite substantial audit and is best done by different types of inodes - S_IFIFO is easy, SIFDIR at least has very few instances, S_IFREG usually wants a real llseek (generic_file_llseek in most cases) and directories also need a llseek method that takes i_mutex so it protects against namespace operations.
| |