Date: Tue, 29 Dec 2020 12:56:23 +0200 From: Konstantin Belousov <kostikbel@gmail.com> To: Arka Sharma <arka.sw1988@gmail.com> Cc: freebsd-hackers@freebsd.org Subject: Re: Updating 'bio_completed' field in case of unwritten LBA Message-ID: <X%2BsLV8ERB2H%2BiTmY@kib.kiev.ua> In-Reply-To: <CAPO=kN01fvns67xN-oHd3=Uva1QxMPeL418Kcg5dprBa4MfgGQ@mail.gmail.com> References: <CAPO=kN01fvns67xN-oHd3=Uva1QxMPeL418Kcg5dprBa4MfgGQ@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Dec 29, 2020 at 11:17:48AM +0530, Arka Sharma wrote: > Hi All, > > Sorry if this is not the right place to ask this question. I am writing a > driver which creates a disk instance and processes bio's coming from GEOM. > GEOM can send read requests for LBA's which are yet to be written. In this > case should we update the 'bio_completed' field in bio instance sent by > GEOM ? Disk must execute the BIO command according to its state at the moment the command is processed. Why does it matter was the block written or not ? If you write a driver for the storage that implements some kind of allocate on write, you need to also allocate on read, and define the state of the block if it was not written yet. Typically such (virtual) storages read the newly allocated block as all zeros.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?X%2BsLV8ERB2H%2BiTmY>