Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Milton Miller and committed by
Linus Torvalds
fff3e5ad d733ed6c

+1 -2
+1 -2
fs/filesystems.c
··· 110 110 *tmp = fs->next; 111 111 fs->next = NULL; 112 112 write_unlock(&file_systems_lock); 113 + synchronize_rcu(); 113 114 return 0; 114 115 } 115 116 tmp = &(*tmp)->next; 116 117 } 117 118 write_unlock(&file_systems_lock); 118 - 119 - synchronize_rcu(); 120 119 121 120 return -EINVAL; 122 121 }