Re: [PATCH] block: fix accounting bug on cross partition merges

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Vivek Goyal
Date: Friday, December 17, 2010 - 3:32 pm

On Fri, Dec 17, 2010 at 08:06:09PM +0100, Jens Axboe wrote:

This is interesting. Using RCU with kref(). So even if somebody has done
a kref_put() and this is last reference, but rcu period is not over, somebody
can still go and take reference again and set it to 1 again and then
partition will not be freed as delete_partition_rcu_cb() will find it set.

I guess read shall have to be atomic_read() and struct kref is opaque so
one might have to introduce kref_read() or something like that and
possibly update Documentation/kref.txt for this usage of with RCU. I would
also recommend it to get it reviewed from  Paul McKenney to make sure this
usage of RCU is fine.

Thanks
Vivek
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 1/2] Don't merge different partition's IOs, Yasuaki Ishimatsu, (Mon Dec 6, 2:44 am)
Re: [PATCH 1/2] Don't merge different partition's IOs, Linus Torvalds, (Mon Dec 6, 9:08 am)
Re: [PATCH 1/2] Don't merge different partition's IOs, Satoru Takeuchi, (Tue Dec 7, 12:18 am)
Re: [PATCH 1/2] Don't merge different partition's IOs, Vivek Goyal, (Tue Dec 7, 11:39 am)
Re: [PATCH 1/2] Don't merge different partition's IOs, Satoru Takeuchi, (Wed Dec 8, 12:59 am)
Re: [PATCH 1/2] Don't merge different partition's IOs, Satoru Takeuchi, (Wed Dec 8, 1:11 am)
Re: [PATCH 1/2] Don't merge different partition's IOs, Jerome Marchand, (Fri Dec 10, 4:22 am)
Re: [PATCH 1/2] Don't merge different partition's IOs, Jerome Marchand, (Fri Dec 10, 9:12 am)
Re: [PATCH 1/2] Don't merge different partition's IOs, Vivek Goyal, (Fri Dec 10, 9:55 am)
[PATCH] block: fix accounting bug on cross partition merges, Jerome Marchand, (Fri Dec 17, 6:42 am)
Re: [PATCH] block: fix accounting bug on cross partition m ..., Vivek Goyal, (Fri Dec 17, 3:32 pm)
[PATCH 1/2] kref: add kref_test_and_get, Jerome Marchand, (Tue Jan 4, 8:52 am)
Re: [PATCH 1/2] kref: add kref_test_and_get, Eric Dumazet, (Tue Jan 4, 9:05 am)
Re: [PATCH 1/2] kref: add kref_test_and_get, Greg KH, (Tue Jan 4, 1:57 pm)