Subject: CVS commit: src/sys/kern
To: None <source-changes@NetBSD.org>
From: Martin Husemann <martin@netbsd.org>
List: source-changes
Date: 12/29/2003 22:08:02
Module Name:	src
Committed By:	martin
Date:		Mon Dec 29 22:08:02 UTC 2003

Modified Files:
	src/sys/kern: uipc_usrreq.c

Log Message:
Avoid using m_clget() on a mbuf already in use, especially when we
need the data in the mbuf later and m_clget() changes some fields
overlaid to regular mbuf data. Instead, rearange code a bit, create
data into a new allocated buffer and and use MEXTADD to attach it to
the mbuf, if the mbuf internal space is not sufficient.

This fixes a crash on sparc64 (and probably all other archs where
sizeof(int) != sizeof(struct file *)) when running
regress/sys/kern/unfdpass.

Idea for solution from Matt Thomas, with additional input from YAMAMOTO
Takashi.


To generate a diff of this commit:
cvs rdiff -r1.72 -r1.73 src/sys/kern/uipc_usrreq.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.