Skip to content

Commit

Permalink
fs: synchronize_rcu when unregister_filesystem success not failure
Browse files Browse the repository at this point in the history
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 <[email protected]>
[ 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 <[email protected]>
  • Loading branch information
Milton Miller authored and torvalds committed Apr 17, 2011
1 parent d733ed6 commit fff3e5a
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions fs/filesystems.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit fff3e5a

Please sign in to comment.