Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp828735imu; Tue, 27 Nov 2018 23:36:51 -0800 (PST) X-Google-Smtp-Source: AFSGD/Vq7PDvfJlD1Ss3MiQ8s4z3X3Mg4r3v21R0pPSEt7SqPUF38/r9GN3Tu7hjE71pA3lZPBzu X-Received: by 2002:a17:902:82c2:: with SMTP id u2mr26173083plz.110.1543390611506; Tue, 27 Nov 2018 23:36:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543390611; cv=none; d=google.com; s=arc-20160816; b=jJKsR7dOAgud3FNoXSyKmcXuWxsWjC0UHmQaWVTkMKrleerTLKli5YBn7wEVU9JL04 pB96rGjZHcibLQQmcDWBnKArjvyEo3yJGp9SYmAtSdLPAJXjO14IlUI/es9Gejfkp47p 35KQIFgMysCE3M1Ilapyty+BqTBGxGgGKsLPKi+XuvlXAk0wrd0O8Ax7XOX4vNtC9WEJ BwTWNTO2hv2emADDIONVxzv2OjD5AUdLstmUupxq3PYQsGtgngQ9eLw0/+PZPyHac0sH vwL5BKZS6OXKx45W0qsx/xigfuDH/PnJkJHqnJmNyOeApsWZFJRSS8T5Zh5bXuu5Jdn6 o6OA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=ZxdhMXe+Z2tenMy0MqStIk9AmzT88JbT65af1MATTDg=; b=VfyN1tEYLZssOBH3u5i3yv18fKZdZJMy5xFw7en/pG3IWohpvSo3sidyAh1w6ChmYM AaqM0jhIKwI/dMLkrG7CsiJlj2xSYHLIHro1ZdeqIA844M3YESD9q8MvwlDcwvJ5rfn3 ZbY+9jK8FV85AWvdT7y6wynwyocKXckjAtkRA//lHt0oMcX7T5LEYRvpSoK923ZejRnJ NqhnjE0lVS3K79oOQN9QILCDDEV5ky9aaYnfgrGgIULCBGTNs+aPAVXf9Oxq2QBViMjf vixrfyJso4BbY0ON7uAOl9ZBjSUmU9sbKeI1nD6EOfivQMaWRkiPzQEUhNGq9Gf0kHrC iihA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=cpbyKj6K; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c136si6868601pfc.141.2018.11.27.23.36.35; Tue, 27 Nov 2018 23:36:51 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=cpbyKj6K; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727519AbeK1SgC (ORCPT + 99 others); Wed, 28 Nov 2018 13:36:02 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:43574 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727247AbeK1SgC (ORCPT ); Wed, 28 Nov 2018 13:36:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=ZxdhMXe+Z2tenMy0MqStIk9AmzT88JbT65af1MATTDg=; b=cpbyKj6KF0BSuwxgAbvrbAyAl L5rHuoN5e0KP4oLLj0GPHYalUUMzRkbBlMNhvdu6meYrCl1cLiiabeO7MhvN+7WtyWQx5TZfii7HJ CuYbuTJwfCe1yDkyajp3WClAd3dBOyeroubUlvu/cwEJjzYhZEboI2hcseknc3OWHG2CBW26nx745 3m54b+oKkKv+Md5hflja1y1GNnsDDX5DzNNA9/gHs3VlTfqgbJAUz7Hq6pYseHism4KNIgNzADXWk DEMx3W8EsEV1LZ0dzvi28UsDz0jSKSh3yxajmdPjv3RfRN0DwnSOvukvQTTnV15UErvasXEVU36GP zhD+e3U+w==; Received: from hch by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1gRuNU-0003Jn-MN; Wed, 28 Nov 2018 07:35:20 +0000 Date: Tue, 27 Nov 2018 23:35:20 -0800 From: Christoph Hellwig To: Dave Chinner Cc: Allison Henderson , linux-block@vger.kernel.org, linux-xfs@vger.kernel.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, martin.petersen@oracle.com, shirley.ma@oracle.com, bob.liu@oracle.com Subject: Re: [PATCH v1 5/7] xfs: Add device retry Message-ID: <20181128073520.GA7084@infradead.org> References: <1543376991-5764-1-git-send-email-allison.henderson@oracle.com> <1543376991-5764-6-git-send-email-allison.henderson@oracle.com> <20181128050850.GJ6311@dastard> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181128050850.GJ6311@dastard> User-Agent: Mutt/1.9.2 (2017-12-15) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Nov 28, 2018 at 04:08:50PM +1100, Dave Chinner wrote: > So the first time through this loop the block layer devices what > device to read from, then we iterate devices 1..n on error. > > Whihc means if device 0 is the only one with good information in it, > we may not ever actually read from it. > > I'd suggest that a hint of "-1" (or equivalent max value) should be > used for "device selects mirror leg" rather than 0, so we can > actually read from the first device on command. Yes. For one thing I think we really need to split this retry counter of sorts from the write hints. I.e. make both u8 types and keep them separate. Then start out with (u8)-1 as initialized by the block layer for the first attempt. The device then fills out which leg it used (in the completion path, so that another underlying driver doesn't override it!), and then the file system just preserves this value on a resumit, leaving the driver to chose a new value when it gets a non -1 value.