summaryrefslogtreecommitdiffstats
path: root/fs/filesystems.c
diff options
context:
space:
mode:
authorMilton Miller2011-04-14 17:30:08 +0200
committerLinus Torvalds2011-04-17 19:42:01 +0200
commitfff3e5ade4455a4b42a19c95dd7a167a3cb7956a (patch)
tree782685d5e479c5a5e167304868c43eca623e6a9e /fs/filesystems.c
parentMerge branch 'for-linus' of git://git.kernel.dk/linux-2.6-block (diff)
downloadkernel-qcow2-linux-fff3e5ade4455a4b42a19c95dd7a167a3cb7956a.tar.gz
kernel-qcow2-linux-fff3e5ade4455a4b42a19c95dd7a167a3cb7956a.tar.xz
kernel-qcow2-linux-fff3e5ade4455a4b42a19c95dd7a167a3cb7956a.zip
fs: synchronize_rcu when unregister_filesystem success not failure
While checking unregister_filesystem for saftey vs extra calls for "ext4: register ext2 and ext3 alias after ext4" I realized that the synchronize_rcu() was called on the error path but not on the success path. Cc: stable (2.6.38) Signed-off-by: Milton Miller <miltonm@bga.com> [ This probably won't really make a difference since commit d863b50ab013 ("vfs: call rcu_barrier after ->kill_sb()"), but it's the right thing to do. - Linus ] Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/filesystems.c')
-rw-r--r--fs/filesystems.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/filesystems.c b/fs/filesystems.c
index 751d6b255a12..0845f84f2a5f 100644
--- a/fs/filesystems.c
+++ b/fs/filesystems.c
@@ -110,14 +110,13 @@ int unregister_filesystem(struct file_system_type * fs)
*tmp = fs->next;
fs->next = NULL;
write_unlock(&file_systems_lock);
+ synchronize_rcu();
return 0;
}
tmp = &(*tmp)->next;
}
write_unlock(&file_systems_lock);
- synchronize_rcu();
-
return -EINVAL;
}