[newRPL] Filesystem sanity checks after SD card reinsertion
|
09-19-2016, 01:02 AM
Post: #2
|
|||
|
|||
RE: [newRPL] File system sanity checks after SD card reinsertion
(09-18-2016 08:43 PM)matthiaspaul Wrote: Split from the main newRPL thread at http://www.hpmuseum.org/forum/thread-464...l#pid61351 It's done, but there's a weakness I haven't been able to resolve. Right now I'm using the card CID which is unique to each card to make sure the user inserts the right card. The exception warns the user and asks to reinsert the card immediately, so no data is lost. If the user doesn't care and inserts a different card, the system detects the card was changed and does a special shutdown of the file system that discards everything without writing it to the card. The new card will remain unmounted until first use. In that regards the protection works as you intended. What I can't prevent is the user from pulling the card with a dirty file system, carelessly disregard the request to reinsert the card, then use the card on a PC, which would make changes to the file system, and then reinsert the card on the 50g. The 50g would detect the same card is back and would keep the volume mounted, which risks corrupting the FAT if we had any pending writes to the FAT. This case is quite rare, though, because the user has to pull the card within 3 seconds of the last write, but it could happen and I don't have a solution in place for it. The last cluster and free space only work on FAT32, so that doesn't help. Also, moving a file to another directory may not allocate any clusters, keeping those counts the same. However, the altered directory may have open files on the 50g, which means there could be up to one sector of buffered data ready to overwrite whatever the PC did. Any other way to achieve this? |
|||
« Next Oldest | Next Newest »
|
Messages In This Thread |
[newRPL] Filesystem sanity checks after SD card reinsertion - matthiaspaul - 09-18-2016, 08:43 PM
RE: [newRPL] File system sanity checks after SD card reinsertion - Claudio L. - 09-19-2016 01:02 AM
|
User(s) browsing this thread: 1 Guest(s)