Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Stop occasionally making file systems with null UUIDs
mkfs.reiser4 was using strncpy() to copy a binary UUID into the in-memory copy of the superblock. So if there was a zero byte in the UUID, then from that point to the end was set to all zeros. If the first byte was zero, a 1 in 256 chance, then the whole UUID was set to zero generating a null UUID for the file system. Fix this. Test case: truncate -s 256M test.img i=0 while : do mkfs.reiser4 --force --yes --label '' test.img line=`debugfs.reiser4 test.img 2> /dev/null | egrep '^uuid:'` ((i++)) echo "[$i] $line" echo "$line" | grep -q '<none>' && break done Output fragment: [1] uuid: 17073919-e41d-4892-9b22-4294d1544c4a [2] uuid: af2821de-ea85-4f20-9621-4fbd128b3fb8 [3] uuid: c0fb805b-e224-4695-a504-d87460d158ae ... [34] uuid: b747540d-5280-4e0f-bae2-922200000000 [35] uuid: d604794d-097f-4810-bbb3-01a1518f3ef1 [36] uuid: 9634100c-1f98-42b3-a684-c9df77ab54e2 [37] uuid: <none> Signed-off-by: Mike Fleetwood <mike.fleetwood@googlemail.com>
- Loading branch information