Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1875397ybv; Sun, 23 Feb 2020 17:24:21 -0800 (PST) X-Google-Smtp-Source: APXvYqxqfDjpfyJIczrY9xcpDzO+teNTRKK8Xcc4z4/rKiAUpjh7lx3cmji28OgApDGhKFt3XLgL X-Received: by 2002:a9d:6a90:: with SMTP id l16mr35939759otq.353.1582507461608; Sun, 23 Feb 2020 17:24:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582507461; cv=none; d=google.com; s=arc-20160816; b=ifosFtU/3vomVly+MvDNAlu67OSOw3i0DpTVi4RJsNEvAnTqPYBci2E4EhToE9q9KD UysclJfqn4DXls9TqJrL67Yc4cTsBI3m9Prw5lW7fqKB/CLtU4006wqa6xHqq3wajeTb nL4tEqBPTUYFCV4RZXLgL3qtqeyfMy+OwU+qpleFRk5H34r0Kj8tBA4aVYHtPa+ozjup zvWZdtzgMtrmGg7j4W8TCWKl4idvt7yda6my5Q5i3WrYEu9jT6CKyxHpv+vlK464S7ZB 4O8bjKMakN1BkePkrui2nktU4NVxAfldyKjzaoGAKhDvR6CD4cssXXsROes1fTtPStN2 vmYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=C8JUnLh89M4fi7B5JYgxQ+iHa3guaoKzTWzA8Cq+bHk=; b=LTocR7kZWCf6SAWAa1FyC75xz2Iz5xSlk9dTqeXpfeWkLAGIdb6kEZAno+HuP8YkZC IddiH49qWom8awQTAKFeSN/EPev27s4PHcs8Er8qvYYDN8HrrFpSpJvv51eHuorhBYni DySXXxyy4MQ8IbT/+Obsi8aVbx8gvSpJ9ywLNza3wWKFogODV1C6yku7EBAcGE50YiNu DeH9rIbtRyKRsq63ffSbBnEQ8xIMdCxkMdzRHvKtz94R5GJJrUTvJTdkFPvEUL8dW2ZE S2ilQh9J7f3J+ak+gmTqX2F8epAwy+OHNAy2JPoAMWrY7Xdsq9FF5hhILi6Vq9+B32y9 bhsQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=BpMXv6ln; 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g15si5078969otk.85.2020.02.23.17.24.08; Sun, 23 Feb 2020 17:24:21 -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=@redhat.com header.s=mimecast20190719 header.b=BpMXv6ln; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727169AbgBXBX7 (ORCPT + 99 others); Sun, 23 Feb 2020 20:23:59 -0500 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:20933 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727151AbgBXBX6 (ORCPT ); Sun, 23 Feb 2020 20:23:58 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1582507437; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=C8JUnLh89M4fi7B5JYgxQ+iHa3guaoKzTWzA8Cq+bHk=; b=BpMXv6lncsLevzzZtr8f+Qg80oUgEaHbZHDIVi27zNDPslpb7QS7hh0leUVsOHYtK6UNqe 4yFQvUxX/2S32dkFS6ECSJS4eNr49Gw8s0jMKqSWbqngVp4O2IedmhN4VD+XV3iDp9ZBG0 7ivruuFf23OZ1LL/LMBMIaVnURIXJXc= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-74-4E8PyZmEOp2GT8nmNgn5gw-1; Sun, 23 Feb 2020 20:23:54 -0500 X-MC-Unique: 4E8PyZmEOp2GT8nmNgn5gw-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E9F828017CC; Mon, 24 Feb 2020 01:23:52 +0000 (UTC) Received: from localhost.localdomain (ovpn-12-24.pek2.redhat.com [10.72.12.24]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 222898B755; Mon, 24 Feb 2020 01:23:50 +0000 (UTC) Subject: Re: [PATCH 02/30] dax: Add missing annotations ofr dax_read_lock() and dax_read_unlock() To: Jules Irenge , boqun.feng@gmail.com Cc: linux-kernel@vger.kernel.org, "open list:DEVICE DIRECT ACCESS DAX" References: <0/30> <20200223231711.157699-1-jbi.octave@gmail.com> <20200223231711.157699-3-jbi.octave@gmail.com> From: Yi Zhang Message-ID: Date: Mon, 24 Feb 2020 09:23:46 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.1.1 MIME-Version: 1.0 In-Reply-To: <20200223231711.157699-3-jbi.octave@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2/24/20 7:16 AM, Jules Irenge wrote: > Sparse reports warning at dax_read_lock() and at dax_read_unlock() > > warning: context imbalance in dax_read_lock() - wrong count at exit > warning: context imbalance in dax_read_unlock() - unexpected unlock > > The root cause is the mnissing annotations at dax_read_lock() > and dax_read_unlock() s/mnissing/missing > Add the missing __acquires(&dax_srcu) notations to dax_read_lock() > Add the missing __releases(&dax_srcu) annotation to dax_read_unlock() > > Signed-off-by: Jules Irenge > --- > drivers/dax/super.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/dax/super.c b/drivers/dax/super.c > index 26a654dbc69a..f872a2fb98d4 100644 > --- a/drivers/dax/super.c > +++ b/drivers/dax/super.c > @@ -28,13 +28,13 @@ static struct super_block *dax_superblock __read_mostly; > static struct hlist_head dax_host_list[DAX_HASH_SIZE]; > static DEFINE_SPINLOCK(dax_host_lock); > > -int dax_read_lock(void) > +int dax_read_lock(void) __acquires(&dax_srcu) > { > return srcu_read_lock(&dax_srcu); > } > EXPORT_SYMBOL_GPL(dax_read_lock); > > -void dax_read_unlock(int id) > +void dax_read_unlock(int id) __releases(&dax_srcu) > { > srcu_read_unlock(&dax_srcu, id); > }