Date: Tue, 29 Dec 2020 12:31:35 -0800 From: John-Mark Gurney <jmg@funkthat.com> To: Arka Sharma <arka.sw1988@gmail.com> Cc: freebsd-hackers@freebsd.org, freebsd-geom@freebsd.org Subject: Re: Updating 'bio_completed' field in case of unwritten LBA Message-ID: <20201229203135.GW31099@funkthat.com> 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
Arka Sharma wrote this message on Tue, Dec 29, 2020 at 11:17 +0530: > Sorry if this is not the right place to ask this question. I am writing a the -geom list is a better place, I have cc'd it there for more visibility... > 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 ? If by not yet written, you're talking about a fresh disk device, that has never been written to, and reads are issued to blocks? If so, this is expected as FreeBSD doesn't know when the dev appears if it's fresh or not... The reads are part of a process called tasting, and it reads data to find out information about the dev, like if it's part of a mirror, or the partitions that are on it and the like... If this is the case, then, I'd suggest you driver return all zero's, that is zero out the buffer, and update the read as if it worked... If you return an error (like geli does when using authenticated encryption), there are many parts of the kernel that will not handle that gracefully... (Just realized that'd be a useful mode for geli to have, to return zeros for failed authentication.) -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not."
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20201229203135.GW31099>