From patchwork Wed Aug 26 22:52:35 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Bottomley X-Patchwork-Id: 7080551 Return-Path: X-Original-To: patchwork-linux-scsi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id D0CC2BEEC1 for ; Wed, 26 Aug 2015 22:52:40 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E2002208DD for ; Wed, 26 Aug 2015 22:52:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E61CF208E8 for ; Wed, 26 Aug 2015 22:52:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752770AbbHZWwi (ORCPT ); Wed, 26 Aug 2015 18:52:38 -0400 Received: from bedivere.hansenpartnership.com ([66.63.167.143]:49876 "EHLO bedivere.hansenpartnership.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752221AbbHZWwh (ORCPT ); Wed, 26 Aug 2015 18:52:37 -0400 Received: from localhost (localhost [127.0.0.1]) by bedivere.hansenpartnership.com (Postfix) with ESMTP id 3D4788EE0DB; Wed, 26 Aug 2015 15:52:37 -0700 (PDT) Received: from bedivere.hansenpartnership.com ([127.0.0.1]) by localhost (bedivere.hansenpartnership.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 4Vr6gdna-77j; Wed, 26 Aug 2015 15:52:37 -0700 (PDT) Received: from [153.66.254.242] (unknown [184.11.141.41]) by bedivere.hansenpartnership.com (Postfix) with ESMTPSA id 74E298EE0D5; Wed, 26 Aug 2015 15:52:36 -0700 (PDT) Message-ID: <1440629555.2196.92.camel@HansenPartnership.com> Subject: Re: IO failures with SMR drives at latest kernel versions From: James Bottomley To: Hannes Reinecke Cc: Anatol Pomozov , Linux SCSI List , hch@lst.de, Tejun Heo Date: Wed, 26 Aug 2015 15:52:35 -0700 In-Reply-To: <55DD5F45.7010905@suse.de> References: <55DAB673.10903@suse.de> <55DD5F45.7010905@suse.de> X-Mailer: Evolution 3.12.11 Mime-Version: 1.0 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Wed, 2015-08-26 at 08:40 +0200, Hannes Reinecke wrote: > On 08/26/2015 06:53 AM, Anatol Pomozov wrote: > > Hi > > > > On Sun, Aug 23, 2015 at 11:15 PM, Hannes Reinecke wrote: > >>> I looked at this commit and it actually adds SMR support to SCSI > >>> layer. Reverting ATA_DEV_ZAC means going back to zones-unaware > >>> algorithms. It is suboptimal but still much better than IO failures > >>> and "BTRFS: lost page write due to I/O error on /dev/sdc" errors I see > >>> at my computer. > >>> > >>> If this SMR support is considered as non-stable, can we at least get a > >>> kernel boot (or config) option that disables ZAC? > >>> > >> Again: Has anybody actually _tested_ that reverting this patch fixes > >> this issue? > > > > Yes I tested it. > > > > This error happens only under heavy load with a lot of read/writes > > (like btrfs rebalance). > > > > With current Linux-4.1.6 'btrfs balance' fails after ~10 minutes after > > start. I reverted ZAC related changes and then ran rebalancing. The > > operation finished successfully after 3 hours of running. > > > Can you be a bit more specific about the 'ZAC related changes'? > There have been several patches, and we really would need to know > which one was the offending one. > Can you try to bisect things here? OK, let's stop shooting the messenger here. There are multiple reports of this problem. The pattern seems to be some type of error causes everything to die. There looks to be an obvious bug in 9162c6579bf90b3f5ddb7e3a6c6fa946c1b4cbeb in that there's no ATA_DEV_ZAC_UNSUP class which means that any attempt to disable the device pushes it up to ATA_DEV_NONE. I'm not sure ... don't have time to follow the code ... but doesn't this interfere with the speed dropping routines which seems to disable then re-enable the device? Does adding ATA_DEV_ZAC_UNSUP fix this problem? patch (compile tested only) below. James Reviewed-by: Hannes Reinecke --- -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/ata/libata-transport.c b/drivers/ata/libata-transport.c index d6c37bc..fa83320 100644 --- a/drivers/ata/libata-transport.c +++ b/drivers/ata/libata-transport.c @@ -144,6 +144,7 @@ static struct { { ATA_DEV_SEMB, "semb" }, { ATA_DEV_SEMB_UNSUP, "semb" }, { ATA_DEV_ZAC, "zac" }, + { ATA_DEV_ZAC_UNSUP, "zac" }, { ATA_DEV_NONE, "none" } }; ata_bitfield_name_search(class, ata_class_names) diff --git a/include/linux/libata.h b/include/linux/libata.h index 36ce37b..49c5b98 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h @@ -191,7 +191,8 @@ enum { ATA_DEV_SEMB = 7, /* SEMB */ ATA_DEV_SEMB_UNSUP = 8, /* SEMB (unsupported) */ ATA_DEV_ZAC = 9, /* ZAC device */ - ATA_DEV_NONE = 10, /* no device */ + ATA_DEV_ZAC_UNSUP = 10, /* ZAC (unsupported) */ + ATA_DEV_NONE = 11, /* no device */ /* struct ata_link flags */ ATA_LFLAG_NO_HRST = (1 << 1), /* avoid hardreset */ @@ -1517,7 +1518,8 @@ static inline unsigned int ata_class_enabled(unsigned int class) static inline unsigned int ata_class_disabled(unsigned int class) { return class == ATA_DEV_ATA_UNSUP || class == ATA_DEV_ATAPI_UNSUP || - class == ATA_DEV_PMP_UNSUP || class == ATA_DEV_SEMB_UNSUP; + class == ATA_DEV_PMP_UNSUP || class == ATA_DEV_SEMB_UNSUP || + class == ATA_DEV_ZAC_UNSUP; } static inline unsigned int ata_class_absent(unsigned int class)