Hi,
Il 23.24 28/07/2002 Henrik Nordström ha scritto:
>Robert is correct that the fields should be tested as bitmasks.
No, is true only for O_WRONLY:
#define O_RDONLY 0 /* +1 == FREAD */
#define O_WRONLY 1 /* +1 == FWRITE */
x & 0 is always 0 .....
And as confirmation, with bitmask test on O_RDONLY, my SquidNT with awin32
hangs, with == test, I run web polygraph for 6 hours with 1.000.000 of
successful Async I/O request.
Regards
Guido
>Only O_RDONLY and O_WRONLY is well defined for a storeioobject within
>Squid. Was probably a bad idea to mirror the UNIX file mode field.
>
>The field is mostly private to each store-io implementation.
>
>Regards
>Henrik
>
>
> > >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
> >
-
=======================================================
Serassio Guido
Via Albenga, 11/4 10134 - Torino - ITALY
E-mail: guido.serassio@serassio.it
WWW: http://www.serassio.it
Received on Tue Jul 30 2002 - 13:16:24 MDT
This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:15:55 MST