Date: Wed, 16 May 2018 23:30:03 +0000 (UTC) From: Kirk McKusick <mckusick@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333693 - head/sys/fs/msdosfs Message-ID: <201805162330.w4GNU3RI001919@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mckusick Date: Wed May 16 23:30:03 2018 New Revision: 333693 URL: https://svnweb.freebsd.org/changeset/base/333693 Log: Revert change made in base r171522 (https://svnweb.freebsd.org/base?view=revision&revision=304232) converting clrbuf() (which clears the entire buffer) to vfs_bio_clrbuf() (which clears only the new pages that have been added to the buffer). Failure to properly remove pages from the buffer cache can make pages that appear not to need clearing to actually have bad random data in them. See for example base r304232 (https://svnweb.freebsd.org/base?view=revision&revision=304232) which noted the need to set B_INVAL and B_NOCACHE as well as clear the B_CACHE flag before calling brelse() to release the buffer. Rather than trying to find all the incomplete brelse() calls, it is simpler, though more slightly expensive, to simply clear the entire buffer when it is newly allocated. PR: 213507 Submitted by: Damjan Jovanovic Reviewed by: kib Modified: head/sys/fs/msdosfs/msdosfs_fat.c Modified: head/sys/fs/msdosfs/msdosfs_fat.c ============================================================================== --- head/sys/fs/msdosfs/msdosfs_fat.c Wed May 16 23:10:19 2018 (r333692) +++ head/sys/fs/msdosfs/msdosfs_fat.c Wed May 16 23:30:03 2018 (r333693) @@ -1082,7 +1082,7 @@ extendfile(struct denode *dep, u_long count, struct bu else bp->b_blkno = blkno; } - vfs_bio_clrbuf(bp); + clrbuf(bp); if (bpp) { *bpp = bp; bpp = NULL;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201805162330.w4GNU3RI001919>