Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp2841353ybv; Mon, 24 Feb 2020 12:42:34 -0800 (PST) X-Google-Smtp-Source: APXvYqwer5rn5BnXf9zrKLqKaOSvz6BvCKbHjoGg7GAneN4/zLg6ijrGdWKcK3d2j95nwINV8nL2 X-Received: by 2002:a05:6830:9a:: with SMTP id a26mr42865419oto.273.1582576954708; Mon, 24 Feb 2020 12:42:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582576954; cv=none; d=google.com; s=arc-20160816; b=ZENcQhculz0XsJoMYTtJOVHhdWL+YPU3vxUgQ69S0vjgzn7HyBCKz/ykYcSPmHbVet 5giHIb6iw5QcbIcnGl7eZ4Gw4+uS+1vo3xMxGJv+VInZkW7Pc9fYiCE/vOUSzS+6mOzd 9Z5atL2dAZZ3WxPLHedQsB9/e0oOeI+M6ssAjII+Alog9hvdQxErnvE42hlpwfClEscU qQQi9SCPvovch1jo1RufZOV6vqaXopDZFCuOJ6BqwOZBapZqq0sCyc3YY75/XwsT/z/Z lPISWY8Qf/McTWpBUEli630T9vPSieoTcq02DtxY1gTZZKJyyyNE2IhTpwNxv0kRab85 xe0Q== 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:dkim-signature; bh=myk+lKJeHf/NwI1kOPcB/C/w3kbJudSAOTZpQWJrDy0=; b=zXPfxHepldh0ikvkZdoqvoqhZikFYIijVK2xX6KSd2YWHXKUdpttJ9v3gJJ5llcbud m+HreWUxwGtsrSLStuvO/C+9NAlBirOUXlE5/E2/DTSlIQKGmMw9nv2pmRndNiChpb/w OqH/Ua4fC75as/7xH8wVhot4LZNxJ7+Q6NUPG2OHazP+LhFL0p8XTRgnnD73GGf0wZ0V SoH1aVzJxeGjryjotS4DKn4T65/RR45GNGKeu0BIInE+hY5s9h+71Bs0byXRWsfOdvcj dnB3RNmQDl6clOdnwci77oJ544H0m8+FK+NqHAQIZUcdlt4mwMuMgYz0T/f6djZxfwLw rknw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=b3YSlCQ2; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q5si6443992otc.104.2020.02.24.12.42.21; Mon, 24 Feb 2020 12:42:34 -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=@gmail.com header.s=20161025 header.b=b3YSlCQ2; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727515AbgBXUl4 (ORCPT + 99 others); Mon, 24 Feb 2020 15:41:56 -0500 Received: from mail-wm1-f65.google.com ([209.85.128.65]:39615 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726722AbgBXUl4 (ORCPT ); Mon, 24 Feb 2020 15:41:56 -0500 Received: by mail-wm1-f65.google.com with SMTP id c84so758938wme.4 for ; Mon, 24 Feb 2020 12:41:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=myk+lKJeHf/NwI1kOPcB/C/w3kbJudSAOTZpQWJrDy0=; b=b3YSlCQ2DhhT1QITJ97tuveUx5HUmQqLdz+spOgtQuuIvUoj1TPqRO4qJlnLa23T1Z GiZpa8KTn9prX+n5E6DpWEAz2eqSSYyKpO0MUthh+HNLxA0AdTppyHboDMcQQ/YhPrfN x8mjqUzAydJeQAEdpPphmdJzWI2rPQdduCVC6nCHL464zNbXsv2t4ojssmSiXwmaqfIR uTNYBh8gsjTxzI+BZWsaDfZN3MRjHEuKeKs1extqa5Irj+Mj1q2YDPQqejRXiXNqU9fS Folm1MWgCiceFpz6pol6s5uVGD5hNnQ3HFLR0k1nA2qJIPe0dZUplLTCvRUz/dwehhg8 CQGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=myk+lKJeHf/NwI1kOPcB/C/w3kbJudSAOTZpQWJrDy0=; b=hwZ++Dl8HR8iXPXUwjTk8yue9eSsQoAaJCrSUrPxmweEMQlLxBt1queOOXiWG2vfyj oYZkRlQLVH0/WU/Ti0TaLjqHBLohgpH+WlrJf2nNlaeXSIyNdBMsHoLs6V4dDRO9nxyr 8JS4f/VcE0qsDeQjUdrspfFFoloDQreWl+VsRqC//CJ0kwMVj+5zBng3eIO6oVC9nNOH HsltwGcXDeHvvRgxeh+lAS/d9HR5XHfnWL2HGcUSAzbfFjD8wh4rTd/JPBq4Xg5t3C3g Mpc83Qd57kDetJithA4aySKCciTr4TKqeOsethK2aeNSkBsdm70r43Amb/HhYCZwkUez QFqQ== X-Gm-Message-State: APjAAAXvjbyN5SXJz3Q5C/Y8FCkVzPp8VAz1qp9RfmZ+n7p8RWz2hkk7 huyQQjeJd57kzfgVUIpT4A== X-Received: by 2002:a1c:2b44:: with SMTP id r65mr796422wmr.72.1582576914733; Mon, 24 Feb 2020 12:41:54 -0800 (PST) Received: from ninjahub.lan (host-2-102-13-223.as13285.net. [2.102.13.223]) by smtp.googlemail.com with ESMTPSA id h128sm863315wmh.33.2020.02.24.12.41.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Feb 2020 12:41:54 -0800 (PST) From: Jules Irenge To: boqun.feng@gmail.com Cc: joseph.qi@linux.alibab.com, Jules Irenge , Mark Fasheh , Joel Becker , Joseph Qi , ocfs2-devel@oss.oracle.com (moderated list:ORACLE CLUSTER FILESYSTEM 2 (OCFS2)), linux-kernel@vger.kernel.org (open list) Subject: [PATCH] ocfs2: Add missing annotations for ocfs2_refcount_cache_lock() and ocfs2_refcount_cache_unlock() Date: Mon, 24 Feb 2020 20:41:30 +0000 Message-Id: <20200224204130.18178-1-jbi.octave@gmail.com> X-Mailer: git-send-email 2.24.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Sparse reports warnings at ocfs2_refcount_cache_lock() and ocfs2_refcount_cache_unlock() warning: context imbalance in ocfs2_refcount_cache_lock() - wrong count at exit warning: context imbalance in ocfs2_refcount_cache_unlock() - unexpected unlock The root cause is the missing annotation at ocfs2_refcount_cache_lock() and at ocfs2_refcount_cache_unlock() Add the missing __acquires(&rf->rf_lock) annotation to ocfs2_refcount_cache_lock() Add the missing __releases(&rf->rf_lock) annotation to ocfs2_refcount_cache_unlock() Signed-off-by: Jules Irenge --- fs/ocfs2/refcounttree.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/ocfs2/refcounttree.c b/fs/ocfs2/refcounttree.c index ee43e51188be..da99c80f49da 100644 --- a/fs/ocfs2/refcounttree.c +++ b/fs/ocfs2/refcounttree.c @@ -154,6 +154,7 @@ ocfs2_refcount_cache_get_super(struct ocfs2_caching_info *ci) } static void ocfs2_refcount_cache_lock(struct ocfs2_caching_info *ci) + __acquires(&rf->rf_lock) { struct ocfs2_refcount_tree *rf = cache_info_to_refcount(ci); @@ -161,6 +162,7 @@ static void ocfs2_refcount_cache_lock(struct ocfs2_caching_info *ci) } static void ocfs2_refcount_cache_unlock(struct ocfs2_caching_info *ci) + __releases(&rf->rf_lock) { struct ocfs2_refcount_tree *rf = cache_info_to_refcount(ci); -- 2.24.1