Hello, Milos Nikic, le jeu. 03 juil. 2025 08:40:43 -0700, a ecrit: > The goal is to capture metadata changes very early in the boot process — > ideally even before fsck — and flush them to a raw device (backed by a file or > similar) synchronously (i.e. the calling thread waits for the result of the > write). > > However, I’ve found that attempting to open() the raw device during early boot > (e.g. from journal_init(), called via diskfs_init_diskfs) can block > indefinitely.
That is expected: you are trying to open a file from the very filesystem that you are initializing... Even if it is a device that you open, you are going through the root filesystem. It will be tricky to try to work around it. What you could do is to call device_open() to directly open the device, without going through the filesystem. That being said, on the long run, you will want to write on the same device as the filesystem, in blocks reserved for the journal. That being said (bis), for now it'll indeed probably be simpler to use a raw device rather than delve into reserving ext2 blocks. You can use device_open/read/write in the interim, but that should probably be only a temporary step. Samuel