The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: corbet@lwn.net (Jonathan Corbet)
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>,
	Thomas Gleixner <tglx@linutronix.de>, Ingo Molnar <mingo@elte.hu>,
	Andrew Morton <akpm@linux-foundation.org>,
	Tony Luck <tony.luck@intel.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: Remove BKL from FAT/VFAT/MSDOS (v1) (was Re: Fw: Regression caused by bf726e "semaphore: fix,")
Date: Thu, 29 May 2008 17:13:37 -0600	[thread overview]
Message-ID: <17765.1212102817@vena.lwn.net> (raw)
In-Reply-To: Your message of "Thu, 29 May 2008 14:37:13 PDT." <alpine.LFD.1.10.0805291413490.3873@woody.linux-foundation.org>

Linus Torvalds <torvalds@linux-foundation.org> wrote:

> Jonathan, do you want an updated replacement patch, or an incremental one, 
> or will you just do that trivial fix yourself?

Something like the attached?  Seems to work for me.  If nobody gripes
I'll stick it into the bkl-removal tree.

jon

Remove deadlocking lock_super() calls from FAT

Linus sez:

	So the end result of that is all the "lock_kernel()" calls in
	fs/fat/file.c should actually just go away - not be replaced by
	lock_super() at alL!

This patch causes that to be.

Signed-off-by: Jonathan Corbet <corbet@lwn.net>


diff --git a/fs/fat/file.c b/fs/fat/file.c
index 7059928..bdf91e9 100644
--- a/fs/fat/file.c
+++ b/fs/fat/file.c
@@ -11,7 +11,6 @@
 #include <linux/mount.h>
 #include <linux/time.h>
 #include <linux/msdos_fs.h>
-#include <linux/smp_lock.h>
 #include <linux/buffer_head.h>
 #include <linux/writeback.h>
 #include <linux/backing-dev.h>
@@ -229,8 +228,7 @@ static int fat_free(struct inode *inode, int skip)
 
 void fat_truncate(struct inode *inode)
 {
-	struct super_block *sb = inode->i_sb;
-	struct msdos_sb_info *sbi = MSDOS_SB(sb);
+	struct msdos_sb_info *sbi = MSDOS_SB(inode->i_sb);
 	const unsigned int cluster_size = sbi->cluster_size;
 	int nr_clusters;
 
@@ -243,9 +241,7 @@ void fat_truncate(struct inode *inode)
 
 	nr_clusters = (inode->i_size + (cluster_size - 1)) >> sbi->cluster_bits;
 
-	lock_super(sb);
 	fat_free(inode, nr_clusters);
-	unlock_super(sb);
 	fat_flush_inodes(inode->i_sb, inode, NULL);
 }
 
@@ -298,14 +294,11 @@ static int fat_allow_set_time(struct msdos_sb_info *sbi, struct inode *inode)
 
 int fat_setattr(struct dentry *dentry, struct iattr *attr)
 {
-	struct super_block *sb = dentry->d_sb;
 	struct msdos_sb_info *sbi = MSDOS_SB(dentry->d_sb);
 	struct inode *inode = dentry->d_inode;
 	int mask, error = 0;
 	unsigned int ia_valid;
 
-	lock_super(sb);
-
 	/*
 	 * Expand the file. Since inode_setattr() updates ->i_size
 	 * before calling the ->truncate(), but FAT needs to fill the
@@ -358,7 +351,6 @@ int fat_setattr(struct dentry *dentry, struct iattr *attr)
 		mask = sbi->options.fs_fmask;
 	inode->i_mode &= S_IFMT | (S_IRWXUGO & ~mask);
 out:
-	unlock_super(sb);
 	return error;
 }
 EXPORT_SYMBOL_GPL(fat_setattr);

  reply	other threads:[~2008-05-29 23:13 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20080510121020.f33c83f7.akpm@linux-foundation.org>
     [not found] ` <20080511073338.GA17137@elte.hu>
     [not found]   ` <20080511075522.GA18214@elte.hu>
     [not found]     ` <Pine.LNX.4.64.0805111150250.32758@titan.stealer.net>
     [not found]       ` <20080511125731.GA28174@elte.hu>
     [not found]         ` <alpine.LFD.1.10.0805110941540.3330@woody.linux-foundation.org>
     [not found]           ` <20080511111210.77858eb4.akpm@linux-foundation.org>
     [not found]             ` <alpine.LFD.1.10.0805111221070.3188@woody.linux-foundation.org>
     [not found]               ` <alpine.LFD.1.10.0805111243250.3188@woody.linux-foundation.org>
     [not found]                 ` <20080511235112.GA16101@elte.hu>
     [not found]                   ` <alpine.LFD.1.10.0805120155490.3514@apollo.tec.linutronix.de>
     [not found]                     ` <alpine.LFD.1.10.0805120723440.3188@woody.linux-foundation.org>
     [not found]                       ` <alpine.LFD.1.10.0805121659470.3514@apollo.tec.linutronix.de>
     [not found]                         ` <alpine.LFD.1.10.0805121324410.3019@woody.linux-foundation.org>
     [not found]                           ` <alpine.LFD.1.10.0805161025510.3255@apollo.tec.linutronix.de>
     [not found]                             ` <alpine.LFD.1.10.0805160906580.2941@woody.linux-foundation.org>
     [not found]                               ` <alpine.LFD.1.10.0805160950180.2941@woody.linux-foundation.org>
2008-05-16 22:36                                 ` Remove BKL from FAT/VFAT/MSDOS (v1) (was Re: Fw: Regression caused by bf726e "semaphore: fix,") Linus Torvalds
2008-05-16 22:58                                   ` Linus Torvalds
2008-05-17  0:25                                   ` OGAWA Hirofumi
2008-05-17  1:31                                     ` Linus Torvalds
2008-05-29 20:45                                       ` Tony Luck
2008-05-29 21:37                                         ` Linus Torvalds
2008-05-29 23:13                                           ` Jonathan Corbet [this message]
2008-05-29 23:17                                             ` Linus Torvalds

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=17765.1212102817@vena.lwn.net \
    --to=corbet@lwn.net \
    --cc=akpm@linux-foundation.org \
    --cc=hirofumi@mail.parknet.co.jp \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=tglx@linutronix.de \
    --cc=tony.luck@intel.com \
    --cc=torvalds@linux-foundation.org \
    /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