Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1101057imu; Wed, 28 Nov 2018 04:44:53 -0800 (PST) X-Google-Smtp-Source: AFSGD/XF9JUJvTZR5cAcwPqXLak9JI5EFHg/zxgevwuoNnhhpJ0kVkT7YXMF608rBPI1r/kjIiwj X-Received: by 2002:a63:960a:: with SMTP id c10mr32742513pge.106.1543409093459; Wed, 28 Nov 2018 04:44:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543409093; cv=none; d=google.com; s=arc-20160816; b=w74CKUtDQ7lSfyHHyHtsya4/rh3QUeCtJ0PtJZkaPHS2u4yRRHhjrnxngCkYvaEeoz m3H7yczuPRkeQUTdZryLBhLG8FHKcASQWG3pLhH5BdttwuoY2ItCbpWKsP2yhvOMwE5Q QuBluCGQJ3Qo+aIUOnFafc4IQUAxbwtMgosdsFAlzp36QH3MVHoDoHOW2HZxdYxTPgPU 1r0JLgowk69+7Q5OioPSVDXu6Lkb19J+YqodmJtTlpWv+h/Tba/NjXsbWWHxNfaswNOS KL0YdcLYcXgps/CZND/883BjG+kRbGHU57sqbSKehrx2VdULQS6HMekLwuMoH8sKVpHx rg5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=LA7CRSqknIo1Ut0TXZU47z3lRwWj0OLvoPru1JLK8Xg=; b=pUiJHLIAUI0FW/SWs2g5zte8pykjDGSIIB2HDoQEp3coV8A15B5jz71EcfUB4mbzsx Y8wHy0APPKwViltsya9OcuUaaILjNhAkRJ+KFGo852QxCxJ4MNvJrLJTNuNY6kXWRkjA DimyLNi7+ZmRP9D/+Fx7QRYuuBnhx6wjnI3h3MrDao0QSJt6R6ATx+cX5XXxRbJ+TAG1 dWP83lN7BCKkwnfiSTfUckWE8C9DnDaSzturEg+K5yKGQ2caEu86z7w3K7JmpLtdX5vI atg+RkN/h0ituGqygOnACOL56pUbCra0vKTnGaH9h5ldYXmktX8AykznDVuISeM3OgGo JQfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=y1RfWGYM; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t11si7041355plo.293.2018.11.28.04.44.38; Wed, 28 Nov 2018 04:44:53 -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=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=y1RfWGYM; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728668AbeK1Xnp (ORCPT + 99 others); Wed, 28 Nov 2018 18:43:45 -0500 Received: from userp2130.oracle.com ([156.151.31.86]:54384 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728201AbeK1Xnp (ORCPT ); Wed, 28 Nov 2018 18:43:45 -0500 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id wASCcXwi046280; Wed, 28 Nov 2018 12:41:53 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : to : cc : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=corp-2018-07-02; bh=LA7CRSqknIo1Ut0TXZU47z3lRwWj0OLvoPru1JLK8Xg=; b=y1RfWGYMMSf1OkebAEAFU/09x0xMiYl3ZnEiqqGh6Df1Tnc/Jm2GKBc/Ho+jE0Jo56aN 5j2dBjiJFekZfIShwLXv3HZfT5jfboRnOrdjWaKCTamHzUlT4CWLK10ocr2/tqW6rA5I bcu9ArSqNiqkU0VD/YVVQSvHqoiRJ6AKHLuJpQZWln941thk0dPoMXavV6AfkF3dlo6h A3Xsa7bcoThH+qN0sM9CF0R6GlOcgiVRcU8RK4K06qfNFK5L9pWHMeiSQHzS10nEvb3z cN8IACfALvhshw7NH9TEPtoBKoEsqWoA/PBdUj2F3dfW8fa/uWBfUrxwxDL6SY5GLA+P KQ== Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp2130.oracle.com with ESMTP id 2nxx2u9y9x-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 28 Nov 2018 12:41:53 +0000 Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id wASCfloW018450 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 28 Nov 2018 12:41:47 GMT Received: from abhmp0001.oracle.com (abhmp0001.oracle.com [141.146.116.7]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id wASCflhe010173; Wed, 28 Nov 2018 12:41:47 GMT Received: from [192.168.1.9] (/116.231.183.115) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 28 Nov 2018 04:41:46 -0800 Subject: Re: [PATCH v1 5/7] xfs: Add device retry To: Christoph Hellwig , 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 References: <1543376991-5764-1-git-send-email-allison.henderson@oracle.com> <1543376991-5764-6-git-send-email-allison.henderson@oracle.com> <20181128050850.GJ6311@dastard> <20181128073520.GA7084@infradead.org> From: Bob Liu Message-ID: Date: Wed, 28 Nov 2018 20:41:40 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <20181128073520.GA7084@infradead.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9090 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1811280112 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/28/18 3:35 PM, Christoph Hellwig wrote: > 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. > Will update as suggested, thank you for all your feedback :) -Bob