Page MenuHomeFreeBSD

ufs: restore uniqueness of st_dev
ClosedPublic

Authored by chs on Sep 29 2020, 10:04 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mar 7 2024, 11:38 PM
Unknown Object (File)
Dec 20 2023, 6:06 AM
Unknown Object (File)
Oct 27 2023, 9:52 AM
Unknown Object (File)
Oct 25 2023, 4:12 PM
Unknown Object (File)
Sep 3 2023, 6:32 AM
Unknown Object (File)
Aug 11 2023, 2:12 AM
Unknown Object (File)
Aug 11 2023, 2:12 AM
Unknown Object (File)
Aug 8 2023, 6:55 PM
Subscribers

Details

Summary

the recently-added ufs_stat() sets st_dev to vp->v_mount->mnt_stat.f_fsid.val[0], but that value is not guaranteed to be unique, only the full 64-bit mnt_stat.f_fsid is guaranteed to be unique. ufs in particular stores the fsid in the superblock at newfs time, and the first 32-bit half is set to the time_t of when newfs was run, so if two file systems are newfs'd in the same second (easy to do with flash storage) then ufs_stat() will report the same st_dev for both file systems. this patch restores uniqueness of st_dev for ufs file systems by changing ufs_stat() to set st_dev to the same value that we used to get before the VOP_STAT() changes.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 33889
Build 31095: arc lint + arc unit