Messages in this thread | | | Date | Mon, 25 Aug 2008 12:21:30 -0400 (EDT) | From | Alan Stern <> | Subject | Re: [PATCH RESEND] klist: don't iterate over deleted entries |
| |
On Mon, 25 Aug 2008, Tejun Heo wrote:
> A klist entry is kept on the list till all its current iterations are > finished; however, a new iteration after deletion also iterates over > deleted entries as long as their reference count stays above zero. > This causes problems for cases where there are users which iterate > over the list while synchronized against list manipulations and > natuarally expect already deleted entries to not show up during > iteration. > > This patch implements dead flag which gets set on deletion so that > iteration can skip already deleted entries. The dead flag piggy backs > on the lowest bit of knode->n_klist and only visible to klist > implementation proper.
This seems like a reasonable sort of thing to do. I had considered something like it in the past, but never bothered because it wasn't needed at the time.
Alan Stern
| |