For the loader to verify files we need stat(2) to
provide st_dev, st_ino, and st_mtime.
Details
- Reviewers
imp tsoome emaste kevans - Commits
- rS334868: Add st_mtime, st_ino and st_dev for ufs_stat
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
For future uploads please include full context - see https://wiki.freebsd.org/action/show/Phabricator
stand/libsa/ufs.c | ||
---|---|---|
847 ↗ | (On Diff #41455) | st_dev differentiates one device from another, st_ino by itself is not unique. fs_id is supposed to be unique per filesystem so can satisfy the requirement, but it is 64bit vs 32bit for st_dev. |
stand/libsa/ufs.c | ||
---|---|---|
847 ↗ | (On Diff #41455) | I guess I should have been more direct. Does it need to be stable from boot to boot, or just stable within a boot? |
stand/libsa/ufs.c | ||
---|---|---|
847 ↗ | (On Diff #41455) | There is no need for stability beyond the current boot. |
stand/libsa/ufs.c | ||
---|---|---|
847 ↗ | (On Diff #41455) | I would like to ask another way still - why should the boot loader care about st_dev and specifically in case of one file system (out of ~8)? Sure, we can fill the fields in hope that maybe there will be some use case in the future, or do you have some followup planned? We would like to avoid implementing inconsistent behavior too - if those fields are to be filled in case of ufs, why not for other file systems? |
Is there a
stand/libsa/ufs.c | ||
---|---|---|
847 ↗ | (On Diff #41455) | To add to that last bit- I'd like to see at least the ZFS analog of this, though I'm not sure how easy it would be to break out inumber (not that familiar with ZFS, didn't seem readily available at a glance). |
stand/libsa/ufs.c | ||
---|---|---|
847 ↗ | (On Diff #41455) | The loader needs to care about st_dev, because in Junos at least; files may read from more than one filesystem, each of which has a /boot/manifest we need to be able to differentiate. |
847 ↗ | (On Diff #41455) | Someone might need to point to where the zfs impl for libsa is ;-) |
stand/libsa/ufs.c | ||
---|---|---|
847 ↗ | (On Diff #41455) | ok, that explains it. |
stand/libsa/ufs.c | ||
---|---|---|
847 ↗ | (On Diff #41455) | I'd start with zfsimp in the poorly conceived stand/zfs directory. |
stand/libsa/ufs.c | ||
---|---|---|
847 ↗ | (On Diff #41455) | imp; did you have any better idea that my trying to squeeze fs_id into st_dev ? |