[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Holding alloc_sem in jffs2_mark_node_obsolete().

On Wednesday 22 January 2003 14:14, David Woodhouse wrote:
> We check for the alloc_sem being held in jffs2_mark_node_obsolete().
> Thomas -- are you seeing the BUG() below? If not, why not? We can get here
> from read_inode() without the alloc_sem being held, AFAICT. If this
> debugging check has served its purpose and made us fix all the places where
> we weren't holding alloc_sem for long enough during writes, I suspect we
> can take it out again now, and stop getting alloc_sem solely to placate
> this rather than for real reasons. OK?
> 	/* We've changed the rules slightly. After
> 	   writing a node you now mustn't drop the
> 	   alloc_sem before you've finished all the
> 	   list management - this is so that when we
> 	   get here, we know that no other nodes have
> 	   been written, and the above check on wbuf
> 	   is valid - wbuf_len is nonzero IFF the node
> 	   which obsoletes this node is still in the
> 	   wbuf.
> 	   So we BUG() if that new rule is broken, to
> 	   make sure we catch it and fix it.
> 	*/
> 	if (!down_trylock(&c->alloc_sem)) {
> 		up(&c->alloc_sem);
> 		printk(KERN_CRIT "jffs2_mark_node_obsolete() called with wbuf active but
> alloc_sem not locked!\n"); BUG();
> 	}

Sorry. This mail got out of sight for some time. I think we should keep it 
there, it ensures the dwmw2-proofness of JFFS2 :)

linutronix - competence in embedded & realtime linux
mail: tglx@xxxxxxx.de

To unsubscribe from this list: send the line "unsubscribe jffs-dev" in
the body of a message to majordomo@xxxxxxx.com