Date: Sun, 13 Apr 2008 22:30:46 -1000 (HST) From: Jeff Roberson <jroberson@jroberson.net> To: Poul-Henning Kamp <phk@phk.freebsd.dk> Cc: arch@FreeBSD.ORG, David Schultz <das@FreeBSD.ORG> Subject: Re: f_offset Message-ID: <20080413222803.D959@desktop> In-Reply-To: <4993.1208156428@critter.freebsd.dk> References: <4993.1208156428@critter.freebsd.dk>
next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, 14 Apr 2008, Poul-Henning Kamp wrote: > In message <20080413131422.V959@desktop>, Jeff Roberson writes: > >> However, f_offset is fetched and set with a shared vnode lock for readers. > > "fetched AND set" with a shared lock ? > > How can that possibly work out sanely ? It doesn't matter which reader wins the race to update offset as long as the resulting offset is entirely valid from one. This is a userspace race otherwise. There is a complication for 64bit offsets on 32bit machines that needs some MD support. Otherwise the write happens in two instructions and can have mixed results. Jeff > > -- > Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 > phk@FreeBSD.ORG | TCP/IP since RFC 956 > FreeBSD committer | BSD since 4.3-tahoe > Never attribute to malice what can adequately be explained by incompetence. >
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20080413222803.D959>