Date: Sat, 16 Dec 2023 20:39:35 -0600 From: Kyle Evans <kevans@FreeBSD.org> To: Konstantin Belousov <kib@FreeBSD.org>, src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: ca39f23347e1 - main - ufs: do not leave around empty buffers shadowing disk content Message-ID: <5ec2e86c-65c5-4733-b22a-443a9c103bde@FreeBSD.org> In-Reply-To: <202312152209.3BFM9J2o038542@gitrepo.freebsd.org> References: <202312152209.3BFM9J2o038542@gitrepo.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On 12/15/23 16:09, Konstantin Belousov wrote: > The branch main has been updated by kib: > > URL: https://cgit.FreeBSD.org/src/commit/?id=ca39f23347e1416a28dde13279bfe5841ad9a746 > > commit ca39f23347e1416a28dde13279bfe5841ad9a746 > Author: Konstantin Belousov <kib@FreeBSD.org> > AuthorDate: 2023-12-11 22:57:28 +0000 > Commit: Konstantin Belousov <kib@FreeBSD.org> > CommitDate: 2023-12-15 22:06:10 +0000 > > ufs: do not leave around empty buffers shadowing disk content > > If the ffs_write() operation specified to overwrite the whole buffer, > ffs tries to save the read by not validating allocated buffer. Then > uiommove() might fail with EFAULT, in which case pages are left zeroed > and marked valid but not read from the disk. Then vn_io_fault() logic > retries the write after holding the user pages to avoid EFAULTs. In > erronous case of really faulty buffer, or in contrived case of writing > from file to itself, we are left with zeroed buffer instead of valid > content written back to disk. > > Handle the situation by releasing non-cached buffer on fault, instead > of clearing it. Note that buffers with alive dependencies cannot be > released, but also either they cannot have valid content on the disk > because dependency on data buffer means that it was not yet written, or > they were reallocated by fragment extension or ffs_reallocbks(), and are > already fully valid. > > Reported by: kevans > Discussed with: mav > In collaboration with: pho > Sponsored by: The FreeBSD Foundation > MFC after: 1 week > Thanks!
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5ec2e86c-65c5-4733-b22a-443a9c103bde>