From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755839Ab3BAHyQ (ORCPT ); Fri, 1 Feb 2013 02:54:16 -0500 Received: from gerard.telenet-ops.be ([195.130.132.48]:42166 "EHLO gerard.telenet-ops.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755693Ab3BAHyL (ORCPT ); Fri, 1 Feb 2013 02:54:11 -0500 Message-ID: <510B749E.8020501@acm.org> Date: Fri, 01 Feb 2013 08:54:06 +0100 From: Bart Van Assche User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130105 Thunderbird/17.0.2 MIME-Version: 1.0 To: Tao Ma CC: linux-scsi@vger.kernel.org, LKML Subject: Re: How to online remove an error scsi disk from the system? References: <510B5CFC.2040801@tao.ma> In-Reply-To: <510B5CFC.2040801@tao.ma> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/01/13 07:13, Tao Ma wrote: > In our product system, we have several sata disks attached to one > machine. So when one of the disk fails, the jbd2(yes, we use ext4) will > hang forever and we will get something in /var/log/messages like below. > It seems to me that the io sent to the scsi layer is never returned back > with -EIO which is a little bit surprised for me(It should be a timeout > somewhere, right?). We have tried echo "offline" > > /sys/block/sdl/device/state, but it doesn't work. So is there any way > for us to let the scsi device returns all the io requests back with EIO > so that all the end_io can be called accordingly? Am I missing something > here? Please note that I'm not familiar with SAS. But I found this in drivers/scsi/scsi_proc.c: * proc_scsi_write - handle writes to /proc/scsi/scsi * @file: not used * @buf: buffer to write * @length: length of buf, at most PAGE_SIZE * @ppos: not used * * Description: this provides a legacy mechanism to add or remove * devices by Host, Channel, ID, and Lun. To use, * "echo 'scsi add-single-device 0 1 2 3' > /proc/scsi/scsi" or * "echo 'scsi remove-single-device 0 1 2 3' > /proc/scsi/scsi" with * "0 1 2 3" replaced by the Host, Channel, Id, and Lun. Bart.