Messages in this thread |  | | | From | Arnd Bergmann <> | | Subject | Re: [PATCH] sony_pi: Remove the BKL from sonypi_misc_open | | Date | Thu, 22 Oct 2009 15:50:04 +0200 |
| |
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 <><
|  |