HomeFreeBSD

msdosfs deextend: validate pages of the partial buffer

Description

msdosfs deextend: validate pages of the partial buffer

Suppose that the cluster size is larger than page size. If the buffer
at the old EOF (before extending) was partial and dirty, it cannot be
automatically neither written out nor validated by the buffer cache,
since extending buffer adds invalid pages at the end.

Correct the buffer state by calling vfs_bio_clrbuf() on it, to mark
newly added and zeroed pages as valid.

Note that UFS is immune to the problem because ffs_truncate() always
allocate the block and buffer for the last byte of the file.

PR: 269341
Reported by: asomers
In collaboration with: pho
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D38549

Details

Provenance
kibAuthored on Feb 11 2023, 6:09 PM
Reviewer
markj
Differential Revision
D38549: msdosfs deextend: validate pages of the partial buffer
Parents
rG67dc1e7b0457: msdosfs deextend(): memoize DETOV(dep)
Branches
Unknown
Tags
Unknown