From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Blunck Subject: [PATCH 15/15] BKL: Update documentation on llseek( =?ISO-8859-1?Q?=08?=) Date: Fri, 20 Nov 2009 17:40:45 +0100 Message-ID: <1258735245-25826-16-git-send-email-jblunck@suse.de> References: <1258735245-25826-1-git-send-email-jblunck@suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: Linux-Kernel Mailinglist , Andrew Morton , Thomas Gleixner , jkacur@redhat.com, Arnd Bergmann , =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Weisbecker?= , Jamie Lokier , Jan Blunck , Christoph Hellwig , Randy Dunlap To: linux-fsdevel@vger.kernel.org, Christoph Hellwig , Alan Cox Return-path: In-Reply-To: <1258735245-25826-1-git-send-email-jblunck@suse.de> Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org The inode's i_size is not protected by the big kernel lock. Therefore i= t 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_p= os. Signed-off-by: Jan Blunck Cc: Arnd Bergmann Cc: Christoph Hellwig Cc: Fr=C3=A9d=C3=A9ric Weisbecker Cc: John Kacur --- Documentation/filesystems/Locking | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Documentation/filesystems/Locking b/Documentation/filesyst= ems/Locking index 18b9d0c..25159d4 100644 --- a/Documentation/filesystems/Locking +++ b/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 modific= ations +since this is something the userspace has to take care about. =20 Note: ext2_release() was *the* source of contention on fs-intensive loads and dropping BKL on ->release() helps to get rid of that (we sti= ll --=20 1.6.4.2