Re: files of size larger than fs size

2005-03-17 Thread Bryan Henderson
>The problem appears to be mixing calls to lseek64 with calls to fread >and fwrite. Oh, of course. I didn't see that. You can't use the file descriptor of a file that is opened as a stream. This test case uses the fileno() function to mess with the internals of the stream. fseeko64() is the

Re: files of size larger than fs size

2005-03-17 Thread Dave Kleikamp
On Thu, 2005-03-17 at 13:48 -0800, Max wrote: > Dave, > > Shouldn't "fread(&data,sizeof(data),1,f)" and "read(fn, &data, > sizeof(data))" produce identical results? > Is it a bug or what? fseek(f, offset, SEEK_SET); fread(&data, sizeof(data, 1, f); should produce identical results to lseek(fn,

Re: files of size larger than fs size

2005-03-17 Thread Max
Dave, Shouldn't "fread(&data,sizeof(data),1,f)" and "read(fn, &data, sizeof(data))" produce identical results? Is it a bug or what? Max Dave Kleikamp wrote: With this change, the file size on jfs becomes 2^48 + 4 as expected. --- jfs_bug.c.orig 2005-03-17 14:18:48.229634648 -0600 +++ jfs_bug

Re: files of size larger than fs size

2005-03-17 Thread Dave Kleikamp
With this change, the file size on jfs becomes 2^48 + 4 as expected. --- jfs_bug.c.orig 2005-03-17 14:18:48.229634648 -0600 +++ jfs_bug.c 2005-03-17 15:32:45.952750104 -0600 @@ -13,12 +13,14 @@ int data = 0; struct flock fl; void read1() { -size_t rc = fread(&data,sizeof(data),1,f);

Re: files of size larger than fs size

2005-03-17 Thread Dave Kleikamp
On Thu, 2005-03-17 at 14:51 -0600, Dave Kleikamp wrote: > On Thu, 2005-03-17 at 12:06 -0800, Bryan Henderson wrote: > > >I found > > >that for larger values, your test program is returning -1, but unsigned > > >it appears as 18446744073709551615. > > > > You mean you ran it? Then what about the m

Re: files of size larger than fs size

2005-03-17 Thread Dave Kleikamp
On Thu, 2005-03-17 at 12:06 -0800, Bryan Henderson wrote: > >I found > >that for larger values, your test program is returning -1, but unsigned > >it appears as 18446744073709551615. > > You mean you ran it? Then what about the more interesting question of > what your filesize ends up to be? Yo

Re: files of size larger than fs size

2005-03-17 Thread Bryan Henderson
>I found >that for larger values, your test program is returning -1, but unsigned >it appears as 18446744073709551615. You mean you ran it? Then what about the more interesting question of what your filesize ends up to be? You say JFS allows files up to 2**52 bytes, so I expect the test case w

Re: files of size larger than fs size

2005-03-17 Thread Dave Kleikamp
On Wed, 2005-03-16 at 20:52 -0800, Max wrote: > Bryan, > > I'm not experienced in filesystems. But I've derived the testcase > program from some buggy application that occasionally created huge > files on my fs. That was not so easy to reproduce since not every > sequence of seeks/reads/writes res

Re: files of size larger than fs size

2005-03-16 Thread Max
Bryan, I'm not experienced in filesystems. But I've derived the testcase program from some buggy application that occasionally created huge files on my fs. That was not so easy to reproduce since not every sequence of seeks/reads/writes results in a huge file. But finally I got it 100% reproduci

Re: files of size larger than fs size

2005-03-16 Thread Bryan Henderson
>But anyway it's interesting why the resulting sparse >files have different size on different fs? That looks like a bug. Assuming you didn't see any seeks or writes fail, the file size on all filesystems should be 2^56 + 4. I suspect this is beyond the maximum file size allowed by the filesys

Re: files of size larger than fs size

2005-03-15 Thread Max
Thanks for the explanation. I closed my bugreport as INVALID. But anyway it's ineteresting why the resulting sparse files have different size on different fs? Max Phillip Lougher wrote: Max wrote: Hello! I've discovered that it is possible to create files of size much larger than partition size.

Re: files of size larger than fs size

2005-03-15 Thread Sonny Rao
On Tue, Mar 15, 2005 at 06:17:52PM -0800, Max wrote: > Hello! > > I've discovered that it is possible to create files of size much larger > than partition size. > I thought that this is JFS bug, so I've filed a bugreport against it at > http://bugzilla.kernel.org/show_bug.cgi?id=4345 > Detailed

Re: files of size larger than fs size

2005-03-15 Thread Phillip Lougher
Max wrote: Hello! I've discovered that it is possible to create files of size much larger than partition size. I thought that this is JFS bug, so I've filed a bugreport against it at http://bugzilla.kernel.org/show_bug.cgi?id=4345 Detailed info and testcase program are provided there. Later I've

files of size larger than fs size

2005-03-15 Thread Max
Hello! I've discovered that it is possible to create files of size much larger than partition size. I thought that this is JFS bug, so I've filed a bugreport against it at http://bugzilla.kernel.org/show_bug.cgi?id=4345 Detailed info and testcase program are provided there. Later I've found that