[Buildroot] [PATCH] fs/ext2: further fix to the UUID

Peter Korsgaard jacmet at uclibc.org
Tue May 28 22:19:04 UTC 2013


>>>>> "Yann" == Yann E MORIN <yann.morin.1998 at free.fr> writes:

 Yann> From: "Yann E. MORIN" <yann.morin.1998 at free.fr>
 Yann> Turned out that setting a nil-UUID is no better than clearing it.

 Yann> What currently happens is as follows:
 Yann>   - first, genext2fs does not generate a UUID
 Yann>   - then we tune2fs to upgrade the filesystem
 Yann>   - then we run fsck, which generates a random UUID
 Yann>   - then we re-run tune2fs to set a nil-UUID

 Yann> So, on the target, if the file system is improperly unmounted (eg.
 Yann> with a power failure), on next boot, fsck may be run, and a new
 Yann> random UUID will be generated.

 Yann> *However*, fsck improperly updates the filesystem when it adds the
 Yann> UUID, and there are a few group descriptor checksum errors.

 Yann> Those errors will go undetected until the next fsck, which will then
 Yann> block for user input (bad on embedded systems, bad).

 Yann> Fix that by systematically generating a random UUID _before_ we call
 Yann> to fsck.

 Yann> A random UUID is not so bad, after all, since there are already so
 Yann> many sources of unpredictability in the filesystem: files date and
 Yann> ordering, files content (date, paths...) which renders a fixed UUID
 Yann> unneeded.

 Yann> And it is still possible to set the UUID in a post-image script if
 Yann> needed, anyway.

Committed, thanks.

-- 
Bye, Peter Korsgaard


More information about the buildroot mailing list