panic: sf_buf_free: freeing free sf_buf

Matthew Dillon dillon at apollo.backplane.com
Mon Oct 20 07:56:54 PDT 2008


:Please nuke the old patch I sent to you on IRC and test following one:
:http://leaf.dragonflybsd.org/~sephe/sendfile.diff1
:
:Best Regards,
:sephe

    FreeBSD has a cute atomic_fetchadd_int() function that can also be
    used.  It is in /archive/FreeBSD-current/src/sys/i386/include/atomic.h.

    Instead of:

	serialize_enter
	subtract_int...
	serialize_exit

    You would do:

	if (atomic_fetchadd_int(&sfm->mref_count, -1) == 1) {
		... last ref went away ...
	}

					-Matt
					Matthew Dillon 
					<dillon at backplane.com>





More information about the Bugs mailing list