From 334e94de9bea353156abd6f2242d3cc4a24562b0 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Sat, 18 Mar 2006 15:05:53 -0500 Subject: [PATCH] deal with rmmod/put_io_context() races Signed-off-by: Al Viro --- block/ll_rw_blk.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'block/ll_rw_blk.c') diff --git a/block/ll_rw_blk.c b/block/ll_rw_blk.c index caa8fcf5474b..6dc769182052 100644 --- a/block/ll_rw_blk.c +++ b/block/ll_rw_blk.c @@ -3477,10 +3477,12 @@ void put_io_context(struct io_context *ioc) BUG_ON(atomic_read(&ioc->refcount) == 0); if (atomic_dec_and_test(&ioc->refcount)) { + rcu_read_lock(); if (ioc->aic && ioc->aic->dtor) ioc->aic->dtor(ioc->aic); if (ioc->cic && ioc->cic->dtor) ioc->cic->dtor(ioc->cic); + rcu_read_unlock(); kmem_cache_free(iocontext_cachep, ioc); } -- cgit v1.2.3