[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freebsd-fs
Subject:    ext2fs locks help
From:       Aditya Sarawgi <sarawgi.aditya () gmail ! com>
Date:       2009-11-25 13:43:09
Message-ID: 4b0d342b.161bf30a.56fa.fffff5ed () mx ! google ! com
[Download RAW message or body]

Hi,

I am experiencing a strange problem with some locks I have applied to 
ext2fs. Here's what is happening

636 	static daddr_t
637 	ext2_alloccg(struct inode *ip, int cg, daddr_t bpref, int size)
638 	{
639 	        struct m_ext2fs *fs;
640 	        struct buf *bp;
641 	        struct ext2mount *ump;
642 	        int error, bno, start, end, loc;
643 	        char *bbp;
644 	        /* XXX ondisk32 */
645 	        mtx_assert(EXT2_MTX(ip->i_ump), MA_OWNED);
646 	        fs = ip->i_e2fs;
647 	        ump = ip->i_ump;
648 	        if (fs->e2fs_gd[cg].ext2bgd_nbfree == 0)
649 	                return (0);
650 	        EXT2_UNLOCK(ump);
		/* snip */

712 	        EXT2_LOCK(ump);

I have added a mutex to ext2mount for protecting fs similar to what ffs 
does. 

Now the problem is that system always panics at line 650 saying that 
panic: lock (sleep mutex) EXT2FS not locked @ 
/usr/src/sys/modules/ext2fs/../../fs/ext2fs/ext2_alloc.c:650

the assertion at 645 never fails and the system always panic at 650 
only. I also tried commenting line 650, the system panics saying that 
trying to recurse a non-recursive lock @ line 712. So the lock is 
getting lost in between. Is this due to some other process unlocking the 
system ?


 
-- 
Aditya Sarawgi
_______________________________________________
freebsd-fs@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-fs
To unsubscribe, send any mail to "freebsd-fs-unsubscribe@freebsd.org"
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic