From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38373) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YyJTZ-0004GV-Eb for qemu-devel@nongnu.org; Fri, 29 May 2015 08:33:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YyJTY-0008FC-PA for qemu-devel@nongnu.org; Fri, 29 May 2015 08:33:25 -0400 Date: Fri, 29 May 2015 13:33:21 +0100 From: Stefan Hajnoczi Message-ID: <20150529123321.GD8598@stefanha-thinkpad.redhat.com> References: <59ff27e9afb45a9f694bb0fa6a86b80494fa0bc8.1432037840.git.berto@igalia.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="SO98HVl1bnMOfKZd" Content-Disposition: inline In-Reply-To: <59ff27e9afb45a9f694bb0fa6a86b80494fa0bc8.1432037840.git.berto@igalia.com> Subject: Re: [Qemu-devel] [PATCH 5/8] throttle: acquire the ThrottleGroup lock in bdrv_swap() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alberto Garcia Cc: Kevin Wolf , qemu-block@nongnu.org, qemu-devel@nongnu.org, Stefan Hajnoczi --SO98HVl1bnMOfKZd Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, May 19, 2015 at 03:24:33PM +0300, Alberto Garcia wrote: > bdrv_swap() touches the fields of a BlockDriverState that are > protected by the ThrottleGroup lock. Although those fields end up in > their original place, they are temporarily swapped in the process, > so there's a chance that an operation on a member of the same group > happening on a different thread can try to use them. >=20 > Signed-off-by: Alberto Garcia > --- > block.c | 16 ++++++++++++++++ > block/throttle-groups.c | 31 ++++++++++++++++++++++++++++++- > include/block/throttle-groups.h | 3 +++ > 3 files changed, 49 insertions(+), 1 deletion(-) Reviewed-by: Stefan Hajnoczi --SO98HVl1bnMOfKZd Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJVaFyRAAoJEJykq7OBq3PIsKMH/AxqgGj3wmSpRqnJPvLo1ZuH KQsRc5BzKWQtNa/NYUG832b+vMTgNA03gsKVX9H6hdZsFFxSGk/oBGDf26QzkX5Q 4lswhPEJV5NPkMHtGBp+vB4ddJc58LpWHsMnt+EzO+sizuLArp0qX5xziQbHt+oK orgsoLGTRgtXJReAGiWelmo4XRQgo6bpE0JbtoQgSNP8WHPWtf56SpEVjISlxXqK xTylvog9CdZjtSq+xzdDoJ20pKWKkv8+EBtnN/ow2K6JBgE7JhN+9uX804k5kUA7 lDdOYrnanGio9gBv/b3ldaXfM34OqfowhXRPNr/Xb1XHcq86Q/2ZR0kNU/3m1T4= =OIZg -----END PGP SIGNATURE----- --SO98HVl1bnMOfKZd--