Re: [PATCH] sony_pi: Remove the BKL from sonypi_misc_open

From: Arnd Bergmann
Date: Thu Oct 22 2009 - 09:50:24 EST


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 <><
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/