Page MenuHomeFreeBSD

msdosfs deextend: validate pages of the partial buffer
ClosedPublic

Authored by kib on Feb 12 2023, 6:52 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Nov 14, 10:16 PM
Unknown Object (File)
Thu, Nov 14, 4:04 PM
Unknown Object (File)
Thu, Nov 7, 3:44 PM
Unknown Object (File)
Tue, Nov 5, 2:26 AM
Unknown Object (File)
Tue, Oct 29, 2:46 PM
Unknown Object (File)
Oct 4 2024, 9:55 AM
Unknown Object (File)
Sep 30 2024, 5:26 PM
Unknown Object (File)
Sep 28 2024, 2:54 PM
Subscribers

Details

Summary
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
In collaboration with:  pho
msdosfs: correct handling of vnode pager size on file extension error

If extension fails, vnode pager recorded size might be left increased.
Only update vnode pager when extension is past the point of no rollback.
allocbuf(): convert direct panic() calls to KASSERT()s

Also do minor style adjustments.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable