Josh, pluknet, good day. Wed, May 07, 2008 at 07:21:18PM +0400, pluknet wrote: > >In doing some data recovery for my brother-in-law, I tried to mount > >his win2k partition (NTFS), and the box immediately panic'd. > > What about this (maybe not very clean) patch? > It helped me to mount ntfs volume without a panic. > I guess ntfs was not modified after some lockmgr changes in feb/march. Wed, May 07, 2008 at 11:41:43AM -0400, Josh Carroll wrote: > Worked like a charm here. Thanks! I am a bit late, but could you please try the patch from the http://www.freebsd.org/cgi/query-pr.cgi?pr=kern/120483 It was ported from NetBSD and seems like it is a bit more complete than the one proposed by pluknet. I was promised to test this myself, but had no time yet to see if it works well, so can I ask you to do it? I will extensively test it myself when time will permit. Thank you both! > --- ntfs_subr.c.orig 2008-05-07 18:17:01.000000000 +0400 > +++ ntfs_subr.c 2008-05-07 18:11:05.000000000 +0400 > _at__at_ -40,6 +40,7 _at__at_ > #include <sys/file.h> > #include <sys/malloc.h> > #include <sys/lock.h> > +#include <sys/sx.h> > #include <sys/iconv.h> > > /* #define NTFS_DEBUG 1 */ > _at__at_ -358,7 +359,8 _at__at_ ntfs_ntget(ip) > > mtx_lock(&ip->i_interlock); > ip->i_usecount++; > - lockmgr(&ip->i_lock, LK_EXCLUSIVE | LK_INTERLOCK, &ip->i_interlock); > + mtx_unlock(&ip->i_interlock); > + sx_xlock(&ip->i_lock); > > return 0; > } > _at__at_ -405,7 +407,7 _at__at_ ntfs_ntlookup( > VREF(ip->i_devvp); > > /* init lock and lock the newborn ntnode */ > - lockinit(&ip->i_lock, PINOD, "ntnode", 0, LK_EXCLUSIVE); > + sx_init(&ip->i_lock, "ntnode"); > mtx_init(&ip->i_interlock, "ntnode interlock", NULL, MTX_DEF); > ntfs_ntget(ip); > > _at__at_ -447,7 +449,8 _at__at_ ntfs_ntput(ip) > #endif > > if (ip->i_usecount > 0) { > - lockmgr(&ip->i_lock, LK_RELEASE|LK_INTERLOCK, &ip->i_interlock); > + mtx_unlock(&ip->i_interlock); > + sx_xunlock(&ip->i_lock); > return; > } > > _at__at_ -462,9 +465,10 _at__at_ ntfs_ntput(ip) > LIST_REMOVE(vap,va_list); > ntfs_freentvattr(vap); > } > - lockmgr(&ip->i_lock, LK_RELEASE | LK_INTERLOCK, &ip->i_interlock); > + mtx_unlock(&ip->i_interlock); > + sx_xunlock(&ip->i_lock); > mtx_destroy(&ip->i_interlock); > - lockdestroy(&ip->i_lock); > + sx_destroy(&ip->i_lock); > vrele(ip->i_devvp); > FREE(ip, M_NTFSNTNODE); > } > --- ntfs_inode.h.orig 2008-05-07 18:14:59.000000000 +0400 > +++ ntfs_inode.h 2008-05-07 15:10:59.000000000 +0400 > _at__at_ -41,6 +41,8 _at__at_ > #define IN_LOADED 0x8000 /* ntvattrs loaded */ > #define IN_PRELOADED 0x4000 /* loaded from directory entry */ > > +#include <sys/_sx.h> > + > struct ntnode { > struct vnode *i_devvp; /* vnode of blk dev we live on */ > struct cdev *i_dev; /* Device associated with the inode. */ > _at__at_ -53,7 +55,7 _at__at_ struct ntnode { > u_int32_t i_flag; > > /* locking */ > - struct lock i_lock; > + struct sx i_lock; > struct mtx i_interlock; > int i_usecount; -- EygeneReceived on Thu May 08 2008 - 05:02:16 UTC
This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:30 UTC