tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: WAPBL not locking enough?



On Tue, May 03, 2016 at 04:30:07PM +0000, Taylor R Campbell wrote:
> - http://nxr.netbsd.org/xref/src/sys/kern/vfs_wapbl.c?r=1.64#1489
> (This one is a little hairier: might need to push the call into
> wapbl_truncate, or require the caller of wapbl_truncate to hold the
> lock on entry and to accept that it will be released/reacquired.)

I've got some problems with understanding the code:

There are two calls for wapbl_truncate, both in wapbl_flush.

- line 1508, a 'normal' call - flush transaction length

- line 1641, in goto out; case,
  if (waitfor) then truncate (wl_circ_size - wl_reserved_bytes).
    (this size seems to be 'everything that can be truncated'.)

  however, this goto out: can only be reached from one case;
	/*
	 * Now that we are fully locked and flushed,
	 * do another check for nothing to do.
	 */
	if (wl->wl_bufcount == 0) {
		goto out;
	}

  I'm confused: how we are doing nothing if we are trying to truncate
  everything (at least sometimes, if waitfor)?

Thanks for responding.


Home | Main Index | Thread Index | Old Index