The patch titled Documentation/filesystems/Locking: update documentation on llseek() wrt BKL has been added to the -mm tree. Its filename is documentation-filesystems-locking-update-documentation-on-llseek-wrt-bkl.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find out what to do about this The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/ ------------------------------------------------------ Subject: Documentation/filesystems/Locking: update documentation on llseek() wrt BKL From: Jan Blunck <jblunck@xxxxxxx> The inode's i_size is not protected by the big kernel lock. Therefore it does not make sense to recommend taking the BKL in filesystems llseek operations. Instead it should use the inode's mutex or use just use i_size_read() instead. Add a note that this is not protecting file->f_pos. Signed-off-by: Jan Blunck <jblunck@xxxxxxx> Acked-by: Alan Cox <alan@xxxxxxxxxxxxxxxxxxx> Cc: Arnd Bergmann <arnd@xxxxxxxx> Cc: Christoph Hellwig <hch@xxxxxxxxxxxxx> Cc: Frederic Weisbecker <fweisbec@xxxxxxxxx> Cc: John Kacur <jkacur@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- Documentation/filesystems/Locking | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff -puN Documentation/filesystems/Locking~documentation-filesystems-locking-update-documentation-on-llseek-wrt-bkl Documentation/filesystems/Locking --- a/Documentation/filesystems/Locking~documentation-filesystems-locking-update-documentation-on-llseek-wrt-bkl +++ a/Documentation/filesystems/Locking @@ -429,8 +429,9 @@ check_flags: no implementations. If your fs is not using generic_file_llseek, you need to acquire and release the appropriate locks in your ->llseek(). For many filesystems, it is probably safe to acquire the inode -semaphore. Note some filesystems (i.e. remote ones) provide no -protection for i_size so you will need to use the BKL. +mutex or just to use i_size_read() instead. +Note: this does not protect the file->f_pos against concurrent modifications +since this is something the userspace has to take care about. Note: ext2_release() was *the* source of contention on fs-intensive loads and dropping BKL on ->release() helps to get rid of that (we still _ Patches currently in -mm which might be from jblunck@xxxxxxx are osst-update-ppos-instead-of-using-file-f_pos.patch drivers-sbus-char-flashc-flash_read-should-update-ppos-instead-of-file-f_pos.patch arch-cris-arch-v10-drivers-eepromc-eeprom_read-eeprom_write-should-update-ppos-instead-of-file-f_pos.patch frv-remove-struct-file-argument-from-sysctl-proc_handler.patch misdn-remove-unnecessary-test-on-f_pos.patch zcrypt-use-nonseekable_open.patch rtc-m41t80-use-nonseekable_open.patch vfs-introduce-noop_llseek.patch osst-use-noop_llseek-instead-of-default_llseek.patch st-use-noop_llseek-instead-of-default_llseek.patch fs-do-not-fallback-to-default_llseek-when-readdir-uses-bkl.patch documentation-filesystems-locking-update-documentation-on-llseek-wrt-bkl.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html