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.