[Cbe-oss-dev] [PATCH] spufs: avoid accessing to released inode
Masato.Noguchi at jp.sony.com
Mon Mar 12 21:54:49 EST 2007
> -----Original Message-----
> From: Christoph Hellwig [mailto:hch at lst.de]
> On Tue, Mar 06, 2007 at 12:44:21PM +0900, Masato Noguchi wrote:
> > This patch modifies the kernel not to access to an address_space
> > of already released inode. Originally, at closing spe context
> > directory, the kernel called unbind_context() and
> > and accessed ctx->local_store (and so on.) after ctx's files purned.
> > FYI, This bug can reproduce reliably by running libspe2 application
> > on the kernel with CONFIG_DEBUG_SLAB and CONFIG_DEBUG_SPINLOCK.
> Thanks, I can reproduce this bug. I don't think your patch is the
> right fix. The problem we're hitting is that the local_store, cntl,
> etc.. pointers in struct spu_context are still set after the inode
> has gone away, and I suspect the right fix is to refcount openers
> of these files and clear the pointers when no one has them open, so
> that we don't try to invalidate them anymore.
Thanks for your review.
I think now I understand what you say. (maybe...)
I did not try your patch because many hunks are failed to patch
about around 'file->f_mapping', but It almost looks good.
By the by, is there no need to add lock of mapping_lock at
spu_unmap_mappings() in spufs/context.c?
More information about the cbe-oss-dev