Re: File Read Returns Non-existent Null Bytes

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

 



> I *think* in the situation where the file is being appended to, you're not
> likely to see anything but nulls.

Agreed.

> I'm not an expert but I think this occurs
> when the read happens between the file size being extended and the new data
> being written, effectively making a 'hole' at the end of the file.

As said in other replies, its because the size is updated causing too
much data to be read out of the page cache, effectively appending
NULLs to the data.

> When you're reading a file that's been concurrently modified, you can get
> corruption (a mix of new and old data) on pretty much any filesystem that
> doesn't enforce mandatory locks.  It's just much less likely on a local
> filesystem because the window is shorter and more operations are atomic.

If you're talking about a local filesystem and you have one process
appending data (with O_APPEND) and another reading, I don't believe
you'll see the same sort of issue (but, I could be wrong).
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux