lkml.org 
[lkml]   [2009]   [Oct]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] sony_pi: Remove the BKL from sonypi_misc_open
Date
On Thursday 22 October 2009, Christoph Hellwig wrote:

> 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.

Is it safe to assume that file_operations without a read() or write()
method also don't need llseek?

There are over 200 instances of file_operations that have a no read,
write or lseek operations and we can easily detect that in vfs_llseek,
calling no_llseek by default.

Testing for S_IFREG will not work well for debugfs, which is probably
a large number of the cases that do not want an llseek method.

Arnd <><


\
 
 \ /
  Last update: 2009-10-22 15:53    [from the cache]
©2003-2011 Jasper Spaans