Page MenuHomeFreeBSD

Get consistent updates for UFS superblocks
Needs ReviewPublic

Authored by mckusick on Fri, Mar 7, 7:46 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Mar 8, 5:45 PM
Unknown Object (File)
Sat, Mar 8, 12:50 PM
Unknown Object (File)
Sat, Mar 8, 10:37 AM
Subscribers

Details

Reviewers
kib
chs
Summary

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.

Test Plan

Have Peter Holm run UFS test suite to find any breakage.

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, ...);
983

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.