linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] BKL: Remove BKL from default_llseek()
@ 2009-11-18 16:07 Jan Blunck
  2009-11-18 16:07 ` [PATCH 2/2] BKL: Update documentation on llseek( \b) Jan Blunck
  2009-11-18 17:15 ` [PATCH 1/2] BKL: Remove BKL from default_llseek() Alan Cox
  0 siblings, 2 replies; 19+ messages in thread
From: Jan Blunck @ 2009-11-18 16:07 UTC (permalink / raw)
  To: linux-fsdevel
  Cc: Linux-Kernel Mailinglist, Andrew Morton, jkacur, Thomas Gleixner,
	Jan Blunck, Arnd Bergmann, Christoph Hellwig,
	Frédéric Weisbecker, Alexander Viro

Using the BKL in llseek() does not protect the inode's i_size from
modification since the i_size is protected by a seqlock nowadays. Since
default_llseek() is already using the i_size_read() wrapper it is not the
BKL which is serializing the access here.
The access to file->f_pos is not protected by the BKL either since its
access in vfs_write()/vfs_read() is not protected by any lock. If the BKL
is not protecting anything here it can clearly get removed.

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>
---
 fs/read_write.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/fs/read_write.c b/fs/read_write.c
index 3ac2898..0e491cc 100644
--- a/fs/read_write.c
+++ b/fs/read_write.c
@@ -107,7 +107,6 @@ loff_t default_llseek(struct file *file, loff_t offset, int origin)
 {
 	loff_t retval;
 
-	lock_kernel();
 	switch (origin) {
 		case SEEK_END:
 			offset += i_size_read(file->f_path.dentry->d_inode);
@@ -128,7 +127,6 @@ loff_t default_llseek(struct file *file, loff_t offset, int origin)
 		retval = offset;
 	}
 out:
-	unlock_kernel();
 	return retval;
 }
 EXPORT_SYMBOL(default_llseek);
-- 
1.6.4.2

^ permalink raw reply related	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2009-11-19 10:13 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-18 16:07 [PATCH 1/2] BKL: Remove BKL from default_llseek() Jan Blunck
2009-11-18 16:07 ` [PATCH 2/2] BKL: Update documentation on llseek( \b) Jan Blunck
2009-11-18 17:15 ` [PATCH 1/2] BKL: Remove BKL from default_llseek() 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

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).