FS#11774 - Unmount all disks before entering USB slave mode to prevent filesystem corruption
Opened by sideral (sideral) - Wednesday, 24 November 2010, 13:44 GMT
Last edited by Frank Gevaerts (fg) - Sunday, 28 November 2010, 15:25 GMT
I recently enabled Rockbox-native USB slave mode on my Sansa ClipV2 through the patch provided in
As I allow Rockbox to write to my disk for various reasons, such as scrobbler logging and database statistics updates. Also, my flash drive is fairly full, leading to frequent disk-block reallocation. Thus I suspected that either (1) the filesystem wasn't fully flushed when USB slave mode was entered, or (2) that Rockbox was using stale filesystem data after returning from USB slave mode that would later lead to filesystem corruption. I slightly lean towards explanation 2, because I never observed filesystem corruption when powering off Rockbox (to use the OF's USB support) even though the shutdown code does not unmount the disks either, AFAIK.
As an experiment, I added support for unmounting all disks before entering USB slave mode – see attached patch. I've been running with this patch for a week now, and I haven't seen any filesystem corruption since then.
Sunday, 28 November 2010, 15:25 GMT
Reason for closing: Accepted
Additional comments about closing: Committed as r28693