freebsd-dev/sys/ufs/ffs
Konstantin Belousov 7428630b75 UFS: write inode block for fdatasync(2) if pointers in inode where allocated
The fdatasync() description in POSIX specifies that
    all I/O operations shall be completed as defined for synchronized I/O
    data integrity completion.
and then the explanation of Synchronized I/O Data Integrity Completion says
    The write is complete only when the data specified in the write
    request is successfully transferred and all file system
    information required to retrieve the data is successfully
    transferred.

For UFS this means that all pointers must be on disk. Indirect
pointers already contribute to the list of dirty data blocks, so only
direct blocks and root pointers to indirect blocks, both of which
reside in the inode block, should be taken care of. In ffs_balloc(),
mark the inode with the new flag IN_IBLKDATA that specifies that
ffs_syncvnode(DATA_ONLY) needs a call to ffs_update() to flush the
inode block.

Reviewed by:	mckusick
Discussed with:	tmunro
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D25072
2020-06-04 12:23:15 +00:00
..
ffs_alloc.c This commit enables a UFS filesystem to do a forcible unmount when 2020-05-25 23:47:31 +00:00
ffs_balloc.c UFS: write inode block for fdatasync(2) if pointers in inode where allocated 2020-06-04 12:23:15 +00:00
ffs_extern.h This commit enables a UFS filesystem to do a forcible unmount when 2020-05-25 23:47:31 +00:00
ffs_inode.c UFS: write inode block for fdatasync(2) if pointers in inode where allocated 2020-06-04 12:23:15 +00:00
ffs_rawread.c vfs: drop the mostly unused flags argument from VOP_UNLOCK 2020-01-03 22:29:58 +00:00
ffs_snapshot.c vfs: stop handling VI_OWEINACT in vget 2020-01-24 07:45:59 +00:00
ffs_softdep.c This commit enables a UFS filesystem to do a forcible unmount when 2020-05-25 23:47:31 +00:00
ffs_subr.c This commit enables a UFS filesystem to do a forcible unmount when 2020-05-25 23:47:31 +00:00
ffs_suspend.c Use the devfs vnode rather than the mntfs vnode for permissions checks. 2020-03-09 15:55:13 +00:00
ffs_tables.c
ffs_vfsops.c This commit enables a UFS filesystem to do a forcible unmount when 2020-05-25 23:47:31 +00:00
ffs_vnops.c UFS: write inode block for fdatasync(2) if pointers in inode where allocated 2020-06-04 12:23:15 +00:00
fs.h Retire two unused background fsck sysctls. 2020-04-21 17:42:32 +00:00
softdep.h This commit enables a UFS filesystem to do a forcible unmount when 2020-05-25 23:47:31 +00:00