RE: pread/pwrite bug on linux?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Trond,

Yes, I did compile it both on 32bit and 64bit, as well as run on both 32bit and 64bit, also tried what you suggested.

Unless there is something else I am missing, the only difference in behavior I saw were the number of iterations pwrite() goes thru before pread() fails... and in all cases, the file size is well under 2GB before pread() failed.

Thanks,
Qiuyang


-----Original Message-----
From: Trond Myklebust [mailto:trond.myklebust@xxxxxxxxxx]
Sent: Tuesday, March 03, 2009 11:37 AM
To: Qiuyang Wu
Cc: Jeff Moyer; linux-nfs@xxxxxxxxxxxxxxx; linux-fsdevel@xxxxxxxxxxxxxxx
Subject: RE: pread/pwrite bug on linux?

On Tue, 2009-03-03 at 10:47 -0800, Qiuyang Wu wrote:
> Hi Jeff,
>
> Attached the sample program. Should be able to compile as-is.
>
> Let me know your findings or need additional info.
>
> Thanks,
> Qiuyang

Are you compiling that on a 64-bit system? Otherwise you should note
that off_t is a signed 32-bit integer. You'd need to compile your test
program with -D_FILE_OFFSET_BITS=64 in order to make those pwrite()
calls work correctly past the 2Gb mark.
You also have potential 32/64-bit issues with the stat_file() routine.

Trond

> -----Original Message-----
> From: Jeff Moyer [mailto:jmoyer@xxxxxxxxxx]
> Sent: Tuesday, March 03, 2009 10:10 AM
> To: Qiuyang Wu
> Cc: linux-nfs@xxxxxxxxxxxxxxx; linux-fsdevel@xxxxxxxxxxxxxxx
> Subject: Re: pread/pwrite bug on linux?
>
> Qiuyang Wu <Qiuyang.Wu@xxxxxxxxxxxx> writes:
>
> > Hi All,
> >
> > Are there any known bugs with pread/pwrite on RHEL Linux when the disk
> > partition is close to full?
> >
> > Reduced a complex application fatal down to a simple program just
> > opens a regular file and performs 1M sequential pwrite() of size 8KB
> > blocks; at every 100th write, does a pread() to load the very first
> > 8KB block and validate its content still matching what was originally
> > written.
>
> Could you attach your test program, please?
>
> > BEHAVIOR: pwrite() works for many iterations, then pread() suddenly
> > returns data of the requested size but filled with 0's, and strerror
> > shows errno="No such file or directory", condition
> >       if(size_to_read != pread(fd, buf, size_to_read, ...)) ...
> > is not triggered and application has to check errno immediately after
> > every call to pread.
>
> The value of errno is undefined if the pread call did not return -1.
>
> Cheers,
> Jeff

--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux