Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 23 Jan 2003 15:49:21 -0800
From:      Juli Mallett <jmallett@FreeBSD.org>
To:        Nate Lawson <nate@root.org>
Cc:        current@FreeBSD.org
Subject:   Re: Test this!  Patch to make newfs(8) use libufs.
Message-ID:  <20030123154921.A66976@FreeBSD.org>
In-Reply-To: <20030123153811.A66302@FreeBSD.org>; from jmallett@FreeBSD.org on Thu, Jan 23, 2003 at 03:38:12PM -0800
References:  <20030123142924.A61481@FreeBSD.org> <Pine.BSF.4.21.0301231507540.73010-100000@root.org> <20030123153811.A66302@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
* De: Juli Mallett <jmallett@FreeBSD.org> [ Data: 2003-01-23 ]
	[ Subjecte: Re: Test this!  Patch to make newfs(8) use libufs. ]
> * De: Nate Lawson <nate@root.org> [ Data: 2003-01-23 ]
> 	[ Subjecte: Re: Test this!  Patch to make newfs(8) use libufs. ]
> > On Thu, 23 Jan 2003, Juli Mallett wrote:
> > > * De: Nate Lawson <nate@root.org> [ Data: 2003-01-23 ]
> > > 	[ Subjecte: Re: Test this!  Patch to make newfs(8) use libufs. ]
> > > > On Thu, 23 Jan 2003, Juli Mallett wrote:
> > > > > Thanks to Ruslan's reminder that tunefs now uses libufs and tunefs is
> > > > > one of the crunched programs, I realised that I really needed to make
> > > > > newfs(8) use libufs.  To show off that it *can* help us reduce space,
> > > > > a good bit in some cases.
> > > > 
> > > > Good to see this.  Does libufs do an fsync() in bwrite() or do you need to
> > > > do that manually in place of the previous calls to wtfsflush()?
> > > 
> > > It doesn't.  Do you think it should?  I'd rather do that than litter the
> > > newfs code.
> > 
> > Not needed.  On second look, I see you removed the wc[] caching and fall
> > back to just write().  (BTW, what's the performance difference with your
> > patch?)  If newfs doesn't complete successfully due to a system crash, it
> > doesn't matter if data written was flushed to disk, just run it again.
> 
> *nod*.  Not to mention that I don't think you need it for writing to a raw
> device?
> 
> As for performance, I don't know.  Test it and find out? :)

I just went to do this, and found that pwrite is failing, saying EBADF.
Could this be because of the failed ioctl?  I'm not sure why this is
happening.  Any thoughts would be appreciated.

 12228 newfs    RET   open 4
 12228 newfs    CALL  fstat(0x4,0xbfbff798)
 12228 newfs    RET   fstat 0
 12228 newfs    CALL  ioctl(0x4,DIOCGSECTORSIZE,0x80509c0)
 12228 newfs    RET   ioctl 0
 12228 newfs    CALL  ioctl(0x4,DIOCGMEDIASIZE,0xbfbff790)
 12228 newfs    RET   ioctl 0
 12228 newfs    CALL  ioctl(0x4,DIOCGDINFO,0x8050480)
 12228 newfs    RET   ioctl -1 errno 25 Inappropriate ioctl for device
 12228 newfs    CALL  gettimeofday(0xbfbff5c8,0)
 12228 newfs    RET   gettimeofday 0
 12228 newfs    CALL  open(0x28111300,0,0)
 12228 newfs    NAMI  "/dev/random"
 12228 newfs    RET   open 5
 12228 newfs    CALL  read(0x5,0x2811d0a4,0x7c)
 12228 newfs    GIO   fd 5 read 124 bytes
       "\^A9\M^I\^S\M-`b\M^Y\M-T~\M-I\b{\M-mN\M-b\M-{(\^Q\M-k|n\M-(     :\M-pA\
        S\^Y\M-|\M-m\M^P\M-M*\M-%\^_e\M^G>\M-v\M-H\M-;2*\M-e\M-E\M-d\M^Y\M^U=\
        \^WrB\^S\M-*\^UuL\0\M-=\M-M7@i\M-t`\M^Y\M-+\M-U\M^X\M-jA{\M-L cq_TvW\
        \^_\M-5\M-Af\M-)\^TP8
        \^U\M-.
        *\^V\^^\M-=\^R\M-e\M-'I\M-Tm\M^BY\M^M\M-W\M^JZ\M-y\240gX\M-=\M^Z\M-)\0\
        \^P\^R\M^]\^Xq\M-F0\M-3"
 12228 newfs    RET   read 124/0x7c
 12228 newfs    CALL  close(0x5)
 12228 newfs    RET   close 0
 12228 newfs    CALL  pwrite(0x4,0x8050a24,0x200,0,0x1fff,0)
 12228 newfs    RET   pwrite -1 errno 9 Bad file descriptor

I didn't notice this before as the test ran fine :/  Last time I trust a test
I didn't write to be honest.  Also, forget to check the return value of code.

Any help would be appreciated.

Thanx,
juli.
-- 
Juli Mallett <jmallett@FreeBSD.org>
AIM: BSDFlata -- IRC: juli on EFnet.
OpenDarwin, Mono, FreeBSD Developer.
ircd-hybrid Developer, EFnet addict.
FreeBSD on MIPS-Anything on FreeBSD.

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030123154921.A66976>