Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753394Ab0DIOCA (ORCPT ); Fri, 9 Apr 2010 10:02:00 -0400 Received: from cantor2.suse.de ([195.135.220.15]:36398 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753074Ab0DIOBb (ORCPT ); Fri, 9 Apr 2010 10:01:31 -0400 From: Jan Blunck To: Linux-Kernel Mailinglist Cc: Andrew Morton , Frederic Weisbecker , Arnd Bergmann , Alan Cox , Jan Blunck , Christoph Hellwig , John Kacur Subject: [PATCH 12/12] Documentation/filesystems/Locking: Update documentation on llseek() wrt BKL Date: Fri, 9 Apr 2010 16:00:55 +0200 Message-Id: <1270821655-4368-13-git-send-email-jblunck@suse.de> X-Mailer: git-send-email 1.6.4.2 In-Reply-To: <1270821655-4368-1-git-send-email-jblunck@suse.de> References: <1270821655-4368-1-git-send-email-jblunck@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1781 Lines: 39 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 Acked-by: Alan Cox Cc: Arnd Bergmann Cc: Christoph Hellwig Cc: Frédéric Weisbecker Cc: John Kacur --- Documentation/filesystems/Locking | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Documentation/filesystems/Locking b/Documentation/filesystems/Locking index 06bbbed..3cfe165 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 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 -- 1.6.4.2 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/