Date: Wed, 25 Nov 2009 19:12:23 +0000 From: Aditya Sarawgi <sarawgi.aditya@gmail.com> To: freebsd-fs@freebsd.org Cc: lulf@freebsd.org Subject: ext2fs locks help Message-ID: <4b0d342b.161bf30a.56fa.fffff5ed@mx.google.com>
next in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4b0d342b.161bf30a.56fa.fffff5ed>