NetBSD-Bugs archive

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

PR/53218 CVS commit: src/sys/kern



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

From: "Maxime Villard" <maxv%netbsd.org@localhost>
To: gnats-bugs%gnats.NetBSD.org@localhost
Cc: 
Subject: PR/53218 CVS commit: src/sys/kern
Date: Sat, 28 Apr 2018 08:16:15 +0000

 Module Name:	src
 Committed By:	maxv
 Date:		Sat Apr 28 08:16:15 UTC 2018
 
 Modified Files:
 	src/sys/kern: uipc_mbuf.c
 
 Log Message:
 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.210 -r1.211 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