[PATCH] cpukit/jffs2: Handle used empty file system

Sebastian Huber sebastian.huber at embedded-brains.de
Mon Feb 5 08:36:44 UTC 2024


Hello Kinsey,

On 02.02.24 23:03, Kinsey Moore wrote:
> On JFFS2 file systems on NOR flash or dataflash that does not have spare
> area for metadata and thus does not invoke delayed writes, it is
> possible to put the file system into a state where all blocks have been
> written to and all files have been deleted from the filesystem. There is
> a bug in the JFFS2 file system scan routine that detects this situation
> as a corrupted file system since the scan routine relies on "used" space
> to discriminate a valid file system when there are blocks that need to
> be erased. The correct fix would require a partial rewrite of the scan
> routine, so instead this patch tracks the space marked as obsolete along
> with space at the end of each block that is otherwise too small to
> contain a JFFS2 node so that it can me compared with the dirty space.
> Corrupted data (or otherwise non-JFFS2 blocks) will still cause this
> check to fail as corrupted data isn't recognized as obsoleted (deleted)
> nodes.

this should be reported to the Linux JFFS2 maintainers. A test case 
would be also nice.

-- 
embedded brains GmbH & Co. KG
Herr Sebastian HUBER
Dornierstr. 4
82178 Puchheim
Germany
email: sebastian.huber at embedded-brains.de
phone: +49-89-18 94 741 - 16
fax:   +49-89-18 94 741 - 08

Registergericht: Amtsgericht München
Registernummer: HRB 157899
Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
Unsere Datenschutzerklärung finden Sie hier:
https://embedded-brains.de/datenschutzerklaerung/


More information about the devel mailing list