Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 10 May 2003 14:09:29 +0100
From:      Ian Dowse <iedowse@maths.tcd.ie>
To:        Juli Mallett <jmallett@FreeBSD.org>
Cc:        Lukas Ertl <l.ertl@univie.ac.at>
Subject:   Re: newfs: useless/bogus check if new last block can be accessed? 
Message-ID:  <200305101409.aa30329@salmon.maths.tcd.ie>
In-Reply-To: Your message of "Fri, 09 May 2003 22:39:31 CDT." <20030509223931.A75707@FreeBSD.org> 

next in thread | previous in thread | raw e-mail | index | archive | help
In message <20030509223931.A75707@FreeBSD.org>, Juli Mallett writes:
>* Ian Dowse <iedowse@maths.tcd.ie> [ Date: 2003-05-09 ]
>> Something like the patch below should do the trick for now. This
>> puts back the old exit code and sector number information, but
>> relies on the undocumented (?) behaviour of bwrite() leaving a
>> sensible value in errno.
>
>That looks pretty sane.  And bwrite is undocumented.  All contracts
>are explicit for now.  Once it's documented that changes.

Actually, the patch isn't quite right, as errno won't be set if
there was a short write instead of an error. Unfortunately, there
is no way to fix this without changing the libufs API, since bwrite()
maps short writes to a -1 return value, so the caller can't tell
whether errno is valid.

I think bwrite() either needs to have the same semantics as pwrite(2),
or else libufs should have the ability to display or return an error
message. To avoid loss of previous functionality, the error message
would need to at least include the errno string, so the string
currently written to d_error is not sufficient.

What is using libufs's bwrite()? Would it be better to just make
errors fatal for now so that a useful diagnostic can be printed?

Ian



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