diff options
author | Jonathan Corbet <corbet@lwn.net> | 2008-05-29 19:14:05 -0400 |
---|---|---|
committer | Jonathan Corbet <corbet@lwn.net> | 2008-07-02 17:06:27 -0400 |
commit | 9c20616c385ebeaa30257ef5d35e8f346db4ee32 (patch) | |
tree | 1042f35fee812262abbacd11f4d7ae523c69c893 /fs/fat | |
parent | 38c4c97c62a30aef276663c1128a2051a25ead7d (diff) |
Make FAT users happier by not deadlocking
The FAT BKL removal patch can cause deadlocks. It turns out that the new
lock_super() calls are unneeded, remove them (as directed by Linus).
Reported-by: "Tony Luck" <tony.luck@intel.com>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Diffstat (limited to 'fs/fat')
-rw-r--r-- | fs/fat/file.c | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/fs/fat/file.c b/fs/fat/file.c index 7059928fb351..bdf91e97397d 100644 --- a/fs/fat/file.c +++ b/fs/fat/file.c | |||
@@ -11,7 +11,6 @@ | |||
11 | #include <linux/mount.h> | 11 | #include <linux/mount.h> |
12 | #include <linux/time.h> | 12 | #include <linux/time.h> |
13 | #include <linux/msdos_fs.h> | 13 | #include <linux/msdos_fs.h> |
14 | #include <linux/smp_lock.h> | ||
15 | #include <linux/buffer_head.h> | 14 | #include <linux/buffer_head.h> |
16 | #include <linux/writeback.h> | 15 | #include <linux/writeback.h> |
17 | #include <linux/backing-dev.h> | 16 | #include <linux/backing-dev.h> |
@@ -229,8 +228,7 @@ static int fat_free(struct inode *inode, int skip) | |||
229 | 228 | ||
230 | void fat_truncate(struct inode *inode) | 229 | void fat_truncate(struct inode *inode) |
231 | { | 230 | { |
232 | struct super_block *sb = inode->i_sb; | 231 | struct msdos_sb_info *sbi = MSDOS_SB(inode->i_sb); |
233 | struct msdos_sb_info *sbi = MSDOS_SB(sb); | ||
234 | const unsigned int cluster_size = sbi->cluster_size; | 232 | const unsigned int cluster_size = sbi->cluster_size; |
235 | int nr_clusters; | 233 | int nr_clusters; |
236 | 234 | ||
@@ -243,9 +241,7 @@ void fat_truncate(struct inode *inode) | |||
243 | 241 | ||
244 | nr_clusters = (inode->i_size + (cluster_size - 1)) >> sbi->cluster_bits; | 242 | nr_clusters = (inode->i_size + (cluster_size - 1)) >> sbi->cluster_bits; |
245 | 243 | ||
246 | lock_super(sb); | ||
247 | fat_free(inode, nr_clusters); | 244 | fat_free(inode, nr_clusters); |
248 | unlock_super(sb); | ||
249 | fat_flush_inodes(inode->i_sb, inode, NULL); | 245 | fat_flush_inodes(inode->i_sb, inode, NULL); |
250 | } | 246 | } |
251 | 247 | ||
@@ -298,14 +294,11 @@ static int fat_allow_set_time(struct msdos_sb_info *sbi, struct inode *inode) | |||
298 | 294 | ||
299 | int fat_setattr(struct dentry *dentry, struct iattr *attr) | 295 | int fat_setattr(struct dentry *dentry, struct iattr *attr) |
300 | { | 296 | { |
301 | struct super_block *sb = dentry->d_sb; | ||
302 | struct msdos_sb_info *sbi = MSDOS_SB(dentry->d_sb); | 297 | struct msdos_sb_info *sbi = MSDOS_SB(dentry->d_sb); |
303 | struct inode *inode = dentry->d_inode; | 298 | struct inode *inode = dentry->d_inode; |
304 | int mask, error = 0; | 299 | int mask, error = 0; |
305 | unsigned int ia_valid; | 300 | unsigned int ia_valid; |
306 | 301 | ||
307 | lock_super(sb); | ||
308 | |||
309 | /* | 302 | /* |
310 | * Expand the file. Since inode_setattr() updates ->i_size | 303 | * Expand the file. Since inode_setattr() updates ->i_size |
311 | * before calling the ->truncate(), but FAT needs to fill the | 304 | * before calling the ->truncate(), but FAT needs to fill the |
@@ -358,7 +351,6 @@ int fat_setattr(struct dentry *dentry, struct iattr *attr) | |||
358 | mask = sbi->options.fs_fmask; | 351 | mask = sbi->options.fs_fmask; |
359 | inode->i_mode &= S_IFMT | (S_IRWXUGO & ~mask); | 352 | inode->i_mode &= S_IFMT | (S_IRWXUGO & ~mask); |
360 | out: | 353 | out: |
361 | unlock_super(sb); | ||
362 | return error; | 354 | return error; |
363 | } | 355 | } |
364 | EXPORT_SYMBOL_GPL(fat_setattr); | 356 | EXPORT_SYMBOL_GPL(fat_setattr); |