Commit fff3e5ad authored by Milton Miller's avatar Milton Miller Committed by Linus Torvalds

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: default avatarMilton Miller <miltonm@bga.com>
[ This probably won't really make a difference since commit d863b50a
  ("vfs: call rcu_barrier after ->kill_sb()"), but it's the right thing
  to do.  - Linus ]
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent d733ed6c
...@@ -110,14 +110,13 @@ int unregister_filesystem(struct file_system_type * fs) ...@@ -110,14 +110,13 @@ int unregister_filesystem(struct file_system_type * fs)
*tmp = fs->next; *tmp = fs->next;
fs->next = NULL; fs->next = NULL;
write_unlock(&file_systems_lock); write_unlock(&file_systems_lock);
synchronize_rcu();
return 0; return 0;
} }
tmp = &(*tmp)->next; tmp = &(*tmp)->next;
} }
write_unlock(&file_systems_lock); write_unlock(&file_systems_lock);
synchronize_rcu();
return -EINVAL; return -EINVAL;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment