linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jan Blunck <jblunck@suse.de>
To: linux-fsdevel@vger.kernel.org
Cc: "Linux-Kernel Mailinglist" <linux-kernel@vger.kernel.org>,
	"Andrew Morton" <akpm@linux-foundation.org>,
	jkacur@redhat.com, "Thomas Gleixner" <tglx@linutronix.de>,
	"Jan Blunck" <jblunck@suse.de>, "Arnd Bergmann" <arnd@arndb.de>,
	"Christoph Hellwig" <hch@infradead.org>,
	"Frédéric Weisbecker" <fweisbec@gmail.com>,
	"Randy Dunlap" <rdunlap@xenotime.net>
Subject: [PATCH 2/2] BKL: Update documentation on llseek( \b)
Date: Wed, 18 Nov 2009 17:07:37 +0100	[thread overview]
Message-ID: <1258560457-15129-2-git-send-email-jblunck@suse.de> (raw)
In-Reply-To: <1258560457-15129-1-git-send-email-jblunck@suse.de>

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@suse.de>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Christoph Hellwig <hch@infradead.org>
Cc: Frédéric Weisbecker <fweisbec@gmail.com>
Cc: John Kacur <jkacur@redhat.com>
---
 Documentation/filesystems/Locking |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/Documentation/filesystems/Locking b/Documentation/filesystems/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 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-fsdevel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2009-11-18 16:07 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-18 16:07 [PATCH 1/2] BKL: Remove BKL from default_llseek() Jan Blunck
2009-11-18 16:07 ` Jan Blunck [this message]
2009-11-18 17:15 ` Alan Cox
2009-11-18 17:27   ` Jamie Lokier
2009-11-18 17:33     ` Arnd Bergmann
2009-11-18 18:00       ` Alan Cox
2009-11-18 18:06         ` Arnd Bergmann
2009-11-18 18:14       ` Alan Cox
2009-11-18 19:17         ` Arnd Bergmann
2009-11-18 17:35     ` Oliver Neukum
2009-11-18 17:50       ` Jamie Lokier
2009-11-18 18:16         ` Alan Cox
2009-11-19  2:40           ` Jamie Lokier
2009-11-19 10:13             ` Alan Cox
2009-11-18 17:55       ` Alan Cox
2009-11-18 17:55       ` Jan Blunck
2009-11-18 17:53   ` Jan Blunck
2009-11-18 18:17     ` Alan Cox
2009-11-18 20:02       ` Jan Blunck

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1258560457-15129-2-git-send-email-jblunck@suse.de \
    --to=jblunck@suse.de \
    --cc=akpm@linux-foundation.org \
    --cc=arnd@arndb.de \
    --cc=fweisbec@gmail.com \
    --cc=hch@infradead.org \
    --cc=jkacur@redhat.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rdunlap@xenotime.net \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).