From: Hannes Reinecke Subject: Re: [PATCH] [SCSI] mpt3sas: Fix secure erase premature termination (v2) Date: Tue, 24 Apr 2018 14:33:41 +0200 Message-ID: <896826b2-7d57-416e-6eb5-7518e70e932b@suse.de> References: <2179ecb8-183f-a500-4d65-10f64f0f43cc@suse.de> <1478045394-19536-1-git-send-email-andrey2805@gmail.com> <30w645ulbhlofxrk1h4a9q3s.1478144944778@email.android.com> <38e3e634-6e08-58bd-bc11-8a0a470b78d9@suse.de> <10db11e2-1e15-2b16-f5e6-81fbf2581683@linux.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Return-path: In-Reply-To: <10db11e2-1e15-2b16-f5e6-81fbf2581683@linux.ibm.com> Content-Language: en-US Sender: stable-owner@vger.kernel.org To: Steffen Maier , "Martin K. Petersen" Cc: Sreekanth Reddy , Igor Rybak , Andrey Grodzovsky , Ezra Kohavi , PDL-MPT-FUSIONLINUX , "linux-scsi@vger.kernel.org" , Sathya Prakash , Chaitra P B , Suganath Prabu Subramani , "stable@vger.kernel.org" List-Id: linux-scsi@vger.kernel.org On 04/24/2018 11:09 AM, Steffen Maier wrote: > > On 11/04/2016 05:35 PM, Martin K. Petersen wrote: >>>>>>> "Hannes" == Hannes Reinecke writes: >> >> Hannes> Checking with SAT-3 (section 6.2.4: Commands the SATL queues >> Hannes> internally) the implemented behaviour is standards conformant, >> Hannes> although the standard also allows for returning 'TASK SET FULL' >> Hannes> or 'BUSY' in these cases.  Doing so would nicely solve this >> Hannes> issue. >> >> I agree with Hannes that it would be appropriate for the SATL to report >> busy when it makes an non-queued command queueable. > > Wouldn't this potentially still cause problems if the secure erase takes > longer than max_retries * scmd_tmo. I.e. the command timing out by > default after 180 seconds as in > https://www.spinics.net/lists/linux-block/msg24837.html ? > > The fix approach here seems to also handle this gracefully. > Well, yes, of course the command will be terminated after it timed out. But typically secure erase is invoked from userspace via sg ioctls, and it's in the responsibility of the application to set the correct timeout. Cheers, Hannes