On Sat, 12 Jul 2003, Anton Altaparmakov wrote:
> Indeed. I had a relatively quick look yesterday but I didn't spot it. I
> assumed it would be a simple logic inversion bug, but this doesn't seem to
> be the case. )-: I will look for it when I have a bit of time hopefully
> I will have some time later today or tomorrow... If any one else looks
> and finds it please let me know!
This is now fixed. It turns out that O_RDONLY = 0 while O_RDWR = 2.
Hence the test:
if ((rwflag & O_RDONLY) == O_RDONLY)
NDevSetReadOnly(dev);
actually meant:
if ((rwflag & 0) == 0)
NDevSetReadOnly(dev);
which of course is always true and hence the device was always set
readonly! Ouch!
I have changed the check to:
if ((rwflag & O_RDWR) != O_RDWR)
NDevSetReadOnly(dev);
And it is all happy now.
mkntfs and ntfsresize work happily again!
Sorry about this but I just didn't expect this to break in such a way and
I only added the readonly stuff too late for my testing. )-:
The fixed version is now both on bkbits and in the latest snapshots.
Best regards,
Anton
--
Anton Altaparmakov <aia21 at cam.ac.uk> (replace at with @)
Unix Support, Computing Service, University of Cambridge, CB2 3QH, UK
Linux NTFS maintainer / IRC: #ntfs on irc.freenode.net
WWW: http://linux-ntfs.sf.net/ & http://www-stu.christs.cam.ac.uk/~aia21/
|