Bug in fs-cifs?

Hi,

I was having some weird problems with the Tiff library when writing to a
windows drive (mounted with fs-cifs). The TIFF file didn’t come out the
right size, and with each attempt to overwrite it, it would get bigger. This
didn’t occur when writing to the local QNX dir.

Anyway, I experimented with some code that works similarly to the Tiff
library when writing. I discovered that if you do an lseek with SEEK_END as
the start point, it doesn’t work right when going to the windows drive. It
works fine when going to the local QNX drive. I’m working with QNX 6.2.1.

I have a windows drive mounted as follows:
fs-cifs //foo:1.1.1.1:/share /fs/nt foo bar

Here’s the code.

#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>

int main ( int argc, char * argv[])
{
int fd,i;
char buf[] = { “hello there” } ;

fd = open (argv[1],O_RDWR | O_CREAT | O_TRUNC, 0666 ) ;

for ( i = 0 ; i < 1000 ; i++ )
{
write ( fd, buf, 11 ) ;
lseek ( fd, 0, SEEK_END ) ;
}
close ( fd) ;
return 0 ;
}

“Foo Bar” <foo@bar.com> wrote in message news:bnkjq1$cij$1@inn.qnx.com

Hi,

I was having some weird problems with the Tiff library when writing to a
windows drive (mounted with fs-cifs). The TIFF file didn’t come out the
right size, and with each attempt to overwrite it, it would get bigger.
This
didn’t occur when writing to the local QNX dir.

Anyway, I experimented with some code that works similarly to the Tiff
library when writing. I discovered that if you do an lseek with SEEK_END
as
the start point, it doesn’t work right when going to the windows drive. It
works fine when going to the local QNX drive. I’m working with QNX 6.2.1.

Hello?

For some more info:
If you create a new file, it’s size is always the size of a single write().
If you overwrite an already existing file, it grows by the size of a single
write() every time the program runs. That’s rather weird, since O_TRUNC is
set…


I have a windows drive mounted as follows:
fs-cifs //foo:1.1.1.1:/share /fs/nt foo bar

Here’s the code.

#include <stdlib.h
#include <unistd.h
#include <fcntl.h

int main ( int argc, char * argv[])
{
int fd,i;
char buf[] = { “hello there” } ;

fd = open (argv[1],O_RDWR | O_CREAT | O_TRUNC, 0666 ) ;

for ( i = 0 ; i < 1000 ; i++ )
{
write ( fd, buf, 11 ) ;
lseek ( fd, 0, SEEK_END ) ;
}
close ( fd) ;
return 0 ;
}

Hello,

Can anyone at QSSL comment on this? It’s proving to be a real pain not to be
able to write TIFF files to a shared directory.

“Foo Bar” <foo@bar.com> wrote in message news:bnovn8$h05$1@inn.qnx.com

“Foo Bar” <> foo@bar.com> > wrote in message news:bnkjq1$cij$> 1@inn.qnx.com> …
Hi,

I was having some weird problems with the Tiff library when writing to a
windows drive (mounted with fs-cifs). The TIFF file didn’t come out the
right size, and with each attempt to overwrite it, it would get bigger.
This
didn’t occur when writing to the local QNX dir.

Anyway, I experimented with some code that works similarly to the Tiff
library when writing. I discovered that if you do an lseek with SEEK_END
as
the start point, it doesn’t work right when going to the windows drive.
It
works fine when going to the local QNX drive. I’m working with QNX
6.2.1.

Hello?

For some more info:
If you create a new file, it’s size is always the size of a single
write().
If you overwrite an already existing file, it grows by the size of a
single
write() every time the program runs. That’s rather weird, since O_TRUNC is
set…



I have a windows drive mounted as follows:
fs-cifs //foo:1.1.1.1:/share /fs/nt foo bar

Here’s the code.

#include <stdlib.h
#include <unistd.h
#include <fcntl.h

int main ( int argc, char * argv[])
{
int fd,i;
char buf[] = { “hello there” } ;

fd = open (argv[1],O_RDWR | O_CREAT | O_TRUNC, 0666 ) ;

for ( i = 0 ; i < 1000 ; i++ )
{
write ( fd, buf, 11 ) ;
lseek ( fd, 0, SEEK_END ) ;
}
close ( fd) ;
return 0 ;
}
\

This issue has been reproduced and a problem report has been created.
It should be fixed in the next release.

Thank you for bringing this to our attention.

Regards,
Barry F.

“Foo Bar” <foo@bar.com> wrote in message news:bnu3c6$4uu$1@inn.qnx.com

Hello,

Can anyone at QSSL comment on this? It’s proving to be a real pain not to
be
able to write TIFF files to a shared directory.

“Foo Bar” <> foo@bar.com> > wrote in message news:bnovn8$h05$> 1@inn.qnx.com> …
“Foo Bar” <> foo@bar.com> > wrote in message
news:bnkjq1$cij$> 1@inn.qnx.com> …
Hi,

I was having some weird problems with the Tiff library when writing to
a
windows drive (mounted with fs-cifs). The TIFF file didn’t come out
the
right size, and with each attempt to overwrite it, it would get
bigger.
This
didn’t occur when writing to the local QNX dir.

Anyway, I experimented with some code that works similarly to the Tiff
library when writing. I discovered that if you do an lseek with
SEEK_END
as
the start point, it doesn’t work right when going to the windows
drive.
It
works fine when going to the local QNX drive. I’m working with QNX
6.2.1.

Hello?

For some more info:
If you create a new file, it’s size is always the size of a single
write().
If you overwrite an already existing file, it grows by the size of a
single
write() every time the program runs. That’s rather weird, since O_TRUNC
is
set…



I have a windows drive mounted as follows:
fs-cifs file://foo:1.1.1.1:/share /fs/nt foo bar

Here’s the code.

#include <stdlib.h
#include <unistd.h
#include <fcntl.h

int main ( int argc, char * argv[])
{
int fd,i;
char buf[] = { “hello there” } ;

fd = open (argv[1],O_RDWR | O_CREAT | O_TRUNC, 0666 ) ;

for ( i = 0 ; i < 1000 ; i++ )
{
write ( fd, buf, 11 ) ;
lseek ( fd, 0, SEEK_END ) ;
}
close ( fd) ;
return 0 ;
}


\