[prev in list] [next in list] [prev in thread] [next in thread] 

List:       yaffs
Subject:    [Yaffs-archive] YAFFS: fix for reading holes
From:       Charles Manning <manningc2 () actrix ! gen ! nz>
Date:       2003-11-06 20:38:08
Message-ID: 20031106203143.9C7B944CA () blood ! actrix ! co ! nz
[Download RAW message or body]

Hi YAFFSers

James found another ugly to do with reading holes, a one liner, now fixed in 
CVS.

The problem was as follows: If you create a new file and lseek off the end of 
the file and write, then you end up with holes in the file (ie. there is no 
physical media used for the unwritten parts of the file). Good so far.

If you then lseek to one of these holes and read, you get undefined data. I 
always thought the reads were undefined, but POSIX wants these to read zeros.
It was easy enough to fix: just memset to 0 the buffer for any reads where a 
NAND page is not found.

Thanx James.

-- Charles

---------------------------------------------------------------------------------------
This mailing list is hosted by Toby Churchill open software (www.toby-churchill.org).
If mailing list membership is no longer wanted you can remove yourself from the list by 
sending an email to yaffs-request@toby-churchill.org with the text "unsubscribe" 
(without the quotes) as the subject. 



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic