From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756670AbbJHUWB (ORCPT ); Thu, 8 Oct 2015 16:22:01 -0400 Received: from mail-ig0-f175.google.com ([209.85.213.175]:33947 "EHLO mail-ig0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755395AbbJHUV7 (ORCPT ); Thu, 8 Oct 2015 16:21:59 -0400 Subject: Re: [PATCH] nbd: Add locking for tasks To: Ben Hutchings , Markus Pargmann References: <20151001060436.GN19121@pengutronix.de> <1444154634-24927-1-git-send-email-mpa@pengutronix.de> <1444335269.2956.268.camel@decadent.org.uk> Cc: nbd-general@lists.sourceforge.net, Michal Belczyk , Hermann Lauer , linux-kernel@vger.kernel.org From: Jens Axboe Message-ID: <5616D065.6070708@kernel.dk> Date: Thu, 8 Oct 2015 14:21:57 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <1444335269.2956.268.camel@decadent.org.uk> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/08/2015 02:14 PM, Ben Hutchings wrote: > On Tue, 2015-10-06 at 20:03 +0200, Markus Pargmann wrote: >> The timeout handling introduced in >> > 7e2893a16d3e (nbd: Fix timeout detection) >> introduces a race condition which may lead to killing of tasks that are >> not in nbd context anymore. This was not observed or reproducable yet. >> >> This patch adds locking to critical use of task_recv and task_send to >> avoid killing tasks that already left the NBD thread functions. This >> lock is only acquired if a timeout occures or the nbd device >> starts/stops. >> >> Reported-by: Ben Hutchings >> Signed-off-by: Markus Pargmann > > Reviewed-by: Ben Hutchings > > You could add 'Fixes: 7e2893a16d3e ("nbd: Fix timeout detection")' to > the commit message as well. I've added your review and the Fixes and added it for this series. Thanks guys. -- Jens Axboe