Superblocks are written by FreeBSD clients using the ffs_sbput() routine (exported from the kernel in sys/ufs/ffs/ffs_subr.c). These clients include the kernel, some geom modules, and system utilities using libufs. Currently, backward compatible updates of UFS superblocks are done only when the kernel writes them. These updates should be done whenever any call to ffs_sbput() is done. This commit moves these UFS superblock compatibility updates from the kernel-specific superblock update to ffs_sbput() so that all clients make these compatibility updates when they write superblocks.
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Skipped - Unit
Tests Skipped
Event Timeline
sys/ufs/ffs/ffs_subr.c | ||
---|---|---|
391 | In such cases, instead of splitting the string literal, Bruce Evans recommended to unindent the line to make string greppable: printf( "WARNING: ....\n", fs->fsmnt, ...); | |
982 | So now fs_si is cleared for the kernel writes as well. What prevents a parallel access to this buffer_si->si_ fields meantime? As I understand, this is due to fact that ump->um_fs in fact never points to the buffer b_data, and always to the private memory block allocate at the mount time. IMO this is worth a comment explaining the subtlety. |
sys/ufs/ffs/ffs_subr.c | ||
---|---|---|
982 | I did add a comment in ffs_update (see line 2035 of ffs_vfsops.c below) noting that we are making a copy of the superblock to write out. I thought putting it there was more useful than putting it in ffs_sbput though I could also put that comment in ffs_sbput if you think it would be helpful. |
sys/ufs/ffs/ffs_subr.c | ||
---|---|---|
990 | I am confused by this comment and the previous discussion. Isn't this struct fs only a copy of the in-kernel source of truth? If yes, why does the kernel need to update fs_si in it, after the write finishes? |
Clarify when the superblock is a copy and fix yet another Peter Holm test failure.
sys/ufs/ffs/ffs_subr.c | ||
---|---|---|
990 | Valid criticism. Comment updated to be more accurate. |