Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp638601ybb; Fri, 3 Apr 2020 09:07:58 -0700 (PDT) X-Google-Smtp-Source: APiQypLGcKRouepVGe5ITshpNE2NArMYiJia2vzlHex0HOwfg8YHaHRGrWE/tVLbdewhlnFhqOXn X-Received: by 2002:aca:c608:: with SMTP id w8mr3679971oif.163.1585930078158; Fri, 03 Apr 2020 09:07:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585930078; cv=none; d=google.com; s=arc-20160816; b=Jxz5CwDmaUXneClQP9EBlvVn8nnG2/ixFXBHHwbPfr1ktkzoW+aZ73v43s3PfeA1+d gikI+YRTwRVDohesdFtKMCHTcd7XpUPtEDw5H6eGc53aopEXsIQ5Lt1an8nhnXf297xm dAVaFvm6bPGhNxX+ucr8s+7KCoRLztJ/jgOFyLn5vOk0GYyz/Pcmab78fl13juby3tOy wUkV0T4bPU3BwJNdc9ZsAFjBnJnYHBN7fjejeLapPsfQZKgtJ3D0PWEh4g0fwxNNIPaE PcC0KBo78h9U5HH3tyWTjElNeSnMGXdRHHoGuuLMeegFxjmV9oUJ8lb5XMEl4xDQpBW2 mmOg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=yWVsg2O9zhGalvGX+nmw8V2YWRG8uH/vlzv7kbC1wXg=; b=o8oz7j+9OV6OQN0QBOWKrHTzfi1eASyE/LEMVC+UM/R3MGxlP470h3YYE7i+uiYUsa 2Kx5k12YDqfRB9gWs55c9/duozjhibOHWqI5KrkbGtlomxbJ8TLhH4pnFZh4qAS4o1XH f6rbJDZz+YWIGLaOqCDtoM1rm4J9GJ6nMsGi5uMGu3XKaep/G4B+Yc/jr17BQib09w2B CYxPU53/PBLeJVGsNG+Hjvp/ZG1l5Oaiek7XRxMduT7chq+Xtft5pMvStZDNJhFXTQs8 b+Ao8njmnexSUYlOwRnw9FHrv8YSneVjwS0hvUWGKGmuWUO/Ch6/AINelgNwbWauvZsw nOOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Giy9dKRu; 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 z13si3505913oix.27.2020.04.03.09.07.42; Fri, 03 Apr 2020 09:07: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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Giy9dKRu; 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 S2403930AbgDCQF7 (ORCPT + 99 others); Fri, 3 Apr 2020 12:05:59 -0400 Received: from mail-wm1-f66.google.com ([209.85.128.66]:55572 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728126AbgDCQF7 (ORCPT ); Fri, 3 Apr 2020 12:05:59 -0400 Received: by mail-wm1-f66.google.com with SMTP id r16so7672177wmg.5 for ; Fri, 03 Apr 2020 09:05:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=yWVsg2O9zhGalvGX+nmw8V2YWRG8uH/vlzv7kbC1wXg=; b=Giy9dKRukI/k1MEXbyHBkt7Gtq+lTH8dlYv4wvBwQui9J39u2LalbRxTH/XL4IeuE1 WusY3MrDEjrStmwsREWrUZh9y0Sm0mlP9KBbPQXdVmFafQgf570zp70UuwGaFnXiZw4M V1f8JZv4BVZuR/7AJqdDrauhs1Hyy2RGGYKjcniJ1bmEDx3NhK1KBhXf2m8Sr2CqQs1R ZYElnSag05ex/GJ3wlbwI5CH9pOeB1ZaVMYo3/WJxqC3VhHFc6WNgWKdH3mvKGj+rmoW jOokU9C2kt9iA/p6SQvbemNnH4VWMWFPIMUKQPEmRh3jyWfdFNiAQhT6zvbEpXtdfPRK ZjIw== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=yWVsg2O9zhGalvGX+nmw8V2YWRG8uH/vlzv7kbC1wXg=; b=BF7Vgx9m0VMOWgnAbpFkYn0na73f7DIS4xc/zG9XsHMqFO4uBX1CgNjraT04MYl1Rq VrjLhxakVemFAMj/+kuGTIr008vPT81QMDou1oiyEWBVEb5x/2hcs+uc0OoTyO9GT0UW XNs9cB6SJdsaei5rUVjHfHPbupidxU45xQU+T6+TtKMrM4bH23BDPD+l0HXQmm9k6y4r zKsYjLvS1SM1cTbirGmgZm1wGa3K8LSb9XBq/a0aD44G77aXKCuRNrf+dC1KJRnxl19Z 7rZKoGFbyO1wKsqZA5Umu4PX67DqGq4M+VOUIUe6Bcbh+76ZQf+uytwh54lfy0WG4IVa bQgw== X-Gm-Message-State: AGi0Pub9Ovl0JC3eqXr65fYQDFtKh8BqAshwTY4mGxeG0k5BinH4rJQT oSm7PvwecaUFBwTowFLskEt2rC/6Vw== X-Received: by 2002:a05:600c:2206:: with SMTP id z6mr9440647wml.188.1585929957222; Fri, 03 Apr 2020 09:05:57 -0700 (PDT) Received: from ninjahost.lan (host-92-23-85-227.as13285.net. [92.23.85.227]) by smtp.gmail.com with ESMTPSA id l12sm12351426wrt.73.2020.04.03.09.05.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Apr 2020 09:05:56 -0700 (PDT) From: Jules Irenge To: linux-kernel@vger.kernel.org Cc: boqun.feng@gmail.com, Andrew Morton , Lu Shuaibing , Nathan Chancellor , Manfred Spraul Subject: [PATCH 1/5] ipc/msg: Add missing annotation for freeque() Date: Fri, 3 Apr 2020 17:05:01 +0100 Message-Id: <20200403160505.2832-2-jbi.octave@gmail.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200403160505.2832-1-jbi.octave@gmail.com> References: <0/5> <20200403160505.2832-1-jbi.octave@gmail.com> 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 a warning at freeque() warning: context imbalance in freeque() - unexpected unlock The root cause is the missing annotation at freeque() Add the missing __releases(RCU) annotation Add the missing __releases(&msq->q_perm) annotation Signed-off-by: Jules Irenge --- ipc/msg.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ipc/msg.c b/ipc/msg.c index caca67368cb5..acd1bc7af55a 100644 --- a/ipc/msg.c +++ b/ipc/msg.c @@ -268,6 +268,8 @@ static void expunge_all(struct msg_queue *msq, int res, * before freeque() is called. msg_ids.rwsem remains locked on exit. */ static void freeque(struct ipc_namespace *ns, struct kern_ipc_perm *ipcp) + __releases(RCU) + __releases(&msq->q_perm) { struct msg_msg *msg, *t; struct msg_queue *msq = container_of(ipcp, struct msg_queue, q_perm); -- 2.24.1