From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Blunck Subject: [PATCH 14/15] BKL: Remove BKL from default_llseek() Date: Fri, 20 Nov 2009 17:40:44 +0100 Message-ID: <1258735245-25826-15-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 , Alexander Viro 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 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 t= he 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 B= KL is not protecting anything here it can clearly get removed. Signed-off-by: Jan Blunck Cc: Arnd Bergmann Cc: Christoph Hellwig Cc: Fr=C3=A9d=C3=A9ric Weisbecker Cc: John Kacur --- 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 7a01d11..cbe54e4 100644 --- a/fs/read_write.c +++ b/fs/read_write.c @@ -113,7 +113,6 @@ loff_t default_llseek(struct file *file, loff_t off= set, int origin) { loff_t retval; =20 - lock_kernel(); switch (origin) { case SEEK_END: offset +=3D i_size_read(file->f_path.dentry->d_inode); @@ -134,7 +133,6 @@ loff_t default_llseek(struct file *file, loff_t off= set, int origin) retval =3D offset; } out: - unlock_kernel(); return retval; } EXPORT_SYMBOL(default_llseek); --=20 1.6.4.2