Skip to content

Commit fff3e5a

Browse files
Milton Millertorvalds
authored andcommitted
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 d863b50 ("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>
1 parent d733ed6 commit fff3e5a

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

‎fs/filesystems.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,14 +110,13 @@ int unregister_filesystem(struct file_system_type * fs)
110110
*tmp = fs->next;
111111
fs->next = NULL;
112112
write_unlock(&file_systems_lock);
113+
synchronize_rcu();
113114
return 0;
114115
}
115116
tmp = &(*tmp)->next;
116117
}
117118
write_unlock(&file_systems_lock);
118119

119-
synchronize_rcu();
120-
121120
return -EINVAL;
122121
}
123122

0 commit comments

Comments
 (0)