NetBSD-Bugs archive

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

PR/53218 CVS commit: [netbsd-6-1] src/sys/kern



The following reply was made to PR kern/53218; it has been noted by GNATS.

From: "Martin Husemann" <martin%netbsd.org@localhost>
To: gnats-bugs%gnats.NetBSD.org@localhost
Cc: 
Subject: PR/53218 CVS commit: [netbsd-6-1] src/sys/kern
Date: Thu, 3 May 2018 15:01:20 +0000

 Module Name:	src
 Committed By:	martin
 Date:		Thu May  3 15:01:20 UTC 2018
 
 Modified Files:
 	src/sys/kern [netbsd-6-1]: uipc_mbuf.c
 
 Log Message:
 Pull up following revision(s) (requested by maxv in ticket #1547):
 
 	sys/kern/uipc_mbuf.c: revision 1.211 (via patch)
 
 Modify m_defrag, so that it never frees the first mbuf of the chain. While
 here use the given 'flags' argument, and not M_DONTWAIT.
 
 We have a problem with several drivers: they poll an mbuf chain from their
 queues and call m_defrag on them, but m_defrag could update the mbuf
 pointer, so the mbuf in the queue is no longer valid. It is not easy to
 fix each driver, because doing pop+push will reorder the queue, and we
 don't really want that to happen.
 
 This problem was independently spotted by me, Kengo, Masanobu, and other
 people too it seems (perhaps PR/53218).
 
 Now m_defrag leaves the first mbuf in place, and compresses the chain
 only starting from the second mbuf in the chain.
 
 It is important not to compress the first mbuf with hacks, because the
 storage of this first mbuf may be shared with other mbufs.
 
 
 To generate a diff of this commit:
 cvs rdiff -u -r1.145.2.1 -r1.145.2.1.2.1 src/sys/kern/uipc_mbuf.c
 
 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.
 


Home | Main Index | Thread Index | Old Index