[Bug 209791] To tunefs utilities I added flag for generate new ufsid (unique filesystem id).

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Thu Jun 2 13:10:01 UTC 2016


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=209791

--- Comment #1 from Pavel Volkov <pavelivolkov at gmail.com> ---
Hello.
To generate a new ufsid I used an algorithm from a file:

/usr/src/sbin/newfs/mkfs.c

    140                 time(&utime);

    465         sblock.fs_id[0] = (long)utime;
    466         sblock.fs_id[1] = newfs_random();

   1149 /*
   1150  * For the regression test, return predictable random values.
   1151  * Otherwise use a true random number generator.
   1152  */
   1153 static u_int32_t
   1154 newfs_random(void)
   1155 {
   1156         static int nextnum = 1;
   1157
   1158         if (Rflag)
   1159                 return (nextnum++);
   1160         return (arc4random());
   1161 }

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-bugs mailing list