Re: AUFS bug ?

From: Guido Serassio <serassio@dont-contact.us>
Date: Sun, 28 Jul 2002 17:04:27 +0200

Hi Robert,

Il 14.34 28/07/2002 Robert Collins ha scritto:
>On Sun, 2002-07-28 at 21:51, Guido Serassio wrote:
> > Hi,
> >
> > I'm working on awin32 fs module of NT port (an aufs WIN32 port by Robert
> > Collins), and l'm found a strange thing in store_io_aufs.c present on
> aufs too:
> >
> > In storeAufsCreate(), sio->mode is set to O_WRONLY | O_BINARY, but in
> > storeAufsOpenDone() (the only place where i can able to find the usage of
> > sio->mode)there is the following code:
> >
> > if (sio->mode == O_WRONLY)
> > storeAufsKickWriteQueue(sio);
> > else if (sio->mode == O_RDONLY)
> > storeAufsKickReadQueue(sio);
> >
> > Instead, in storeAufsOpen(), sio->mode is set to O_RDONLY. There are no
> any
> > other places with sio->mode assignment, so, I think that the assignment in
> > storeAufsCreate() is wrong.
> >
> > Any other opinions ?
>
>There is a bug, but not the assignment.
>
>The correct fix is:
>
>if (sio->mode & O_WRONLY)
>else if (sio->mode & O_RDONLY).
>
>In storeAufsOpen, the sio->mode should be O_RDONLY | O_BINARY.
>
>Rob

I think that the meaning and use of sio->mode are not clear:

- in store_io_ufs.c is set to O_RDONLY or O_WRONLY | O_CREAT | O_TRUNC |
O_BINARY, but never tested
- in store_io_diskd.c is set to O_RDONLY or O_WRONLY | O_CREAT | O_TRUNC
and tested only as O_RDONLY, so there is a logical bug, but things works
- in store_io_coss.c is set to O_WRONLY or O_RDONLY and tested only as O_WRONLY
- in store_io_aufs.c is set to O_RDONLY or O_WRONLY | O_BINARY and tested
as O_RDONLY or O_WRONLY, and this is wrong without doubt

It seems to be used only simply for mark read or write mode of cache files.

So, my question are:

1) what means exactly sio->mode ?
2) Is correct use for it the O_* values ?

Regards

Guido

-
=======================================================
Serassio Guido
Via Albenga, 11/4 10134 - Torino - ITALY
E-mail: guido.serassio@serassio.it
WWW: http://www.serassio.it
Received on Sun Jul 28 2002 - 09:04:40 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:15:54 MST