From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752841AbbH1PR3 (ORCPT ); Fri, 28 Aug 2015 11:17:29 -0400 Received: from mail-wi0-f179.google.com ([209.85.212.179]:37434 "EHLO mail-wi0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752010AbbH1PR1 (ORCPT ); Fri, 28 Aug 2015 11:17:27 -0400 Date: Fri, 28 Aug 2015 17:17:24 +0200 From: Michal Hocko To: James Bottomley Cc: Dan Williams , linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] scsi: fix scsi_error_handler vs. scsi_host_dev_release race Message-ID: <20150828151724.GH5301@dhcp22.suse.cz> References: <1440699420-30499-1-git-send-email-mhocko@kernel.org> <1440773773.2202.9.camel@HansenPartnership.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1440773773.2202.9.camel@HansenPartnership.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri 28-08-15 07:56:13, James Bottomley wrote: [...] > > diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c > > index 6457a8a0db9c..2c0a817d5dbe 100644 > > --- a/drivers/scsi/scsi_error.c > > +++ b/drivers/scsi/scsi_error.c > > @@ -2169,8 +2169,11 @@ int scsi_error_handler(void *data) > > * We never actually get interrupted because kthread_run > > * disables signal delivery for the created thread. > > */ > > - while (!kthread_should_stop()) { > > + while (true) { > > Comment here, I think, please to avoid any other erroneous tidying > attempts. How about > > /* > * The sequence in kthread_stop() sets the stop flag first then > * wakes the process. To avoid missed wakeups, the task should always > * be in a non running state before the stop flag is checked > */ > > Otherwise this looks fine. I do not have objections to the added comment. -- Michal Hocko SUSE Labs