freebsd-dev/sys/ufs/ffs
Kirk McKusick 513274c79c Clear the IN_SIZEMOD and IN_IBLKDATA flags only when doing a
synchronous inode update.

The IN_SIZEMOD and IN_IBLKDATA flags indicate changes to the
file size and block pointer fields in the inode. When these
fields have been changed, the fsync() and fsyncdata() system
calls must write the inode to ensure their semantics that the
file is on stable store.

The IN_SIZEMOD and IN_IBLKDATA flags cannot be cleared until
a synchronous write of the inode is done. If they are cleared
on an asynchronous write, then the inode may not yet have been
written to the disk when an fsync() or fsyncdata() call is done.
Absent these flags, these calls would not know that they needed
to write the inode. Thus, these flags only can be cleared on
synchronous writes of the inode. Since the inode will be locked
for the duration of the I/O that writes it to disk, no fsync()
or fsyncdata() will be able to run before the on-disk inode
is complete.

Reviewed by: kib
MFC with: -r361785
Differential revision:  https://reviews.freebsd.org/D25072
2020-06-06 20:17:56 +00:00
..
ffs_alloc.c Further evaluation of the POSIX spec for fdatasync() shows that it 2020-06-05 01:00:55 +00:00
ffs_balloc.c Further evaluation of the POSIX spec for fdatasync() shows that it 2020-06-05 01:00:55 +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 Clear the IN_SIZEMOD and IN_IBLKDATA flags only when doing a 2020-06-06 20:17:56 +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 Further evaluation of the POSIX spec for fdatasync() shows that it 2020-06-05 01:00:55 +00:00
ffs_softdep.c Further evaluation of the POSIX spec for fdatasync() shows that it 2020-06-05 01:00:55 +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 Further evaluation of the POSIX spec for fdatasync() shows that it 2020-06-05 01:00:55 +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