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