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

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Vivek Goyal
Date: Thursday, December 23, 2010 - 8:39 am

On Thu, Dec 23, 2010 at 04:10:04PM +0100, Jerome Marchand wrote:

It might happen that kref_get(part) is called after kref_put() has been
called and reference has reached 0 and and delete_parition() call has
been scheduled as soon as rcu grace period is over. So if you do
kref_get() after that, it is not going to help.


Conceptually it kind of makes sense to me. So if even if we get the
pointer to partition under rcu_read_lock(), we will not account the IO
to partition if it is going away.


Do we have to check this part->partno both while taking and releasing
reference. Can't we take one extra reference for disk->part0, at
alloc_disk_node() time so that it is never freed and only freed when
disk is going away and gendisk is being freed.

That way, you don't have to differentiate between disk->part0 and rest
of the partitions while taking or dropping references.

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, (Thu Dec 23, 8:39 am)
[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)