]> git.baikalelectronics.ru Git - kernel.git/commit
vfs: call rcu_barrier after ->kill_sb()
authorBoaz Harrosh <bharrosh@panasas.com>
Thu, 10 Feb 2011 23:01:20 +0000 (15:01 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 12 Feb 2011 00:12:19 +0000 (16:12 -0800)
commit269029126bf8c7abd31faab16586332235760fa9
tree88d27ed4717bb49ba696f2efb5ef024388412af3
parent8218022ca6f3ea57a558962a927c56499b21d660
vfs: call rcu_barrier after ->kill_sb()

In commit 0f2f7e871878 ("fs: icache RCU free inodes"), we use rcu free
inode instead of freeing the inode directly.  It causes a crash when we
rmmod immediately after we umount the volume[1].

So we need to call rcu_barrier after we kill_sb so that the inode is
freed before we do rmmod.  The idea is inspired by Aneesh Kumar.
rcu_barrier will wait for all callbacks to end before preceding.  The
original patch was done by Tao Ma, but synchronize_rcu() is not enough
here.

1. http://marc.info/?l=linux-fsdevel&m=129680863330185&w=2

Tested-by: Tao Ma <boyu.mt@taobao.com>
Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
Cc: Nick Piggin <npiggin@kernel.dk>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Chris Mason <chris.mason@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/super.c