diff options
author | Jeremy Kerr <jk@ozlabs.org> | 2007-11-15 21:32:23 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2007-11-20 00:10:20 -0500 |
commit | c443acab2eebf12dce7e78fe29e76786f55ad1be (patch) | |
tree | c740b3e4ee8c75ade937b2c8fc9fcbeb7f87cfe6 /arch/powerpc | |
parent | a2b51812a4dc5db09ab4d4638d4d8ed456e2457e (diff) |
[POWERPC] spufs: Fix context destroy vs /spu readdir race
We can currently cause an oops by repeatedly creating and destroying
contexts, while doing getdents() calls on the "/spu" directory.
This is due to the context's top-level dentry remaining hashed while
the context is being destroyed.
Fix this by unhashing the context's dentry with the
dentry->d_inode->i_mutex held. This way, we'll hit the check for
d_unhashed in dentry_readdir, and won't be included in the
list of subdirs for /spu.
test: spufs-testsuite:tests/01-spu_create/07-destroy-vs-readdir-race
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc')
-rw-r--r-- | arch/powerpc/platforms/cell/spufs/inode.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/powerpc/platforms/cell/spufs/inode.c b/arch/powerpc/platforms/cell/spufs/inode.c index 0966d093db43..c0e968a4c211 100644 --- a/arch/powerpc/platforms/cell/spufs/inode.c +++ b/arch/powerpc/platforms/cell/spufs/inode.c | |||
@@ -171,6 +171,7 @@ static int spufs_rmdir(struct inode *parent, struct dentry *dir) | |||
171 | { | 171 | { |
172 | /* remove all entries */ | 172 | /* remove all entries */ |
173 | spufs_prune_dir(dir); | 173 | spufs_prune_dir(dir); |
174 | d_drop(dir); | ||
174 | 175 | ||
175 | return simple_rmdir(parent, dir); | 176 | return simple_rmdir(parent, dir); |
176 | } | 177 | } |