Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3423485ybi; Tue, 2 Jul 2019 07:31:58 -0700 (PDT) X-Google-Smtp-Source: APXvYqyoPyBY47QawX/PhtVDr0cSLsfSNGUMbxRyCszRtm2XJljzZc+tQ0HPFi+lYMhLbNqclZ2u X-Received: by 2002:a17:902:f81:: with SMTP id 1mr35231596plz.191.1562077918561; Tue, 02 Jul 2019 07:31:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562077918; cv=none; d=google.com; s=arc-20160816; b=UPUHU/BNeCTqBifyRnfXPYcWwLkJ4lDCgcdfKZIh9gtkQJHN8Vrnf/EMryEZvPLAG3 Xzdn6r6jf2LdvPPdd55702ZWuEK6u2f0KYYLYlXJWI6O7K2ntkRgBSX6Wk6bRsS1Jg2y 62nz66NBjVlGO6Hvxoct1du3zw78xOl1WEipUJzJ5+7FD0Kj+gzrNeYhzXzblzEjIC/w NYmj8T3nLlBc3crFeJQpDNwchm/TnPDRvDGQLfk0Mywkt/R5A9cejvgEbNJxMtjU4Sjf 1T/NSljCND3RBeB9+0GjLrucvc9Wor0xPJSM2i2jIcrdtW+Ugzr68hTMQkGs8cuv9nd8 92tw== 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:mime-version :message-id:date:subject:cc:to:from; bh=lXYTrJgeGS4nYahyn3MMFjAHCLsAVcbutSWoAMqwEmw=; b=HJuQiUc29cUwxQI+AcKfVrmHQ/pwrso2a0QM5JrBPHCm/4zo+Ur4hUsN3KP5n8bfuw MzeHlJL3sefUFSRfXDAZHfyExzMhiy/9ojMOsdyF0Z1k5XxW6qIVBUq3ZVVQEasL1gOM QlK+RwlCYhhADsqnyrI4dGxfrV/drlEQCHGL49+9Vo4dLBl/sANnmAVwqIYMzO3l77fU K2eH0YAt86Dmg1q2xWMKIie8rsoa849Y6+oWHSkBxmMNT42Qkt5kW1+y/p4JSUZBuZ/d S1D1Gfw3mHwPL9trrque5QQVPNIcLGNcDpOBcjMNL5rZTVH2lOD39SuOhKJw4Wu7W9rA i3Iw== ARC-Authentication-Results: i=1; mx.google.com; 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 h69si3634708pge.543.2019.07.02.07.31.42; Tue, 02 Jul 2019 07:31:58 -0700 (PDT) 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; 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 S1727122AbfGBOaJ (ORCPT + 99 others); Tue, 2 Jul 2019 10:30:09 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:8125 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726341AbfGBOaI (ORCPT ); Tue, 2 Jul 2019 10:30:08 -0400 Received: from DGGEMS406-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 7981A1CC68EC19C4B931; Tue, 2 Jul 2019 22:30:06 +0800 (CST) Received: from huawei.com (10.90.53.225) by DGGEMS406-HUB.china.huawei.com (10.3.19.206) with Microsoft SMTP Server id 14.3.439.0; Tue, 2 Jul 2019 22:30:04 +0800 From: Hou Tao To: , CC: Subject: [PATCH] raid1: use an int as the return value of raise_barrier() Date: Tue, 2 Jul 2019 22:35:48 +0800 Message-ID: <20190702143548.133020-1-houtao1@huawei.com> X-Mailer: git-send-email 2.22.0 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.90.53.225] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Using a sector_t as the return value is misleading, because raise_barrier() only return 0 or -EINTR. Also add comments for the return values of raise_barrier(). Signed-off-by: Hou Tao --- drivers/md/raid1.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c index da06bb47195b..c1ea5e0c3cf6 100644 --- a/drivers/md/raid1.c +++ b/drivers/md/raid1.c @@ -846,8 +846,10 @@ static void flush_pending_writes(struct r1conf *conf) * backgroup IO calls must call raise_barrier. Once that returns * there is no normal IO happeing. It must arrange to call * lower_barrier when the particular background IO completes. + * + * Will return -EINTR if resync/recovery is interrupted, else return 0. */ -static sector_t raise_barrier(struct r1conf *conf, sector_t sector_nr) +static int raise_barrier(struct r1conf *conf, sector_t sector_nr) { int idx = sector_to_idx(sector_nr); -- 2.22.0