Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp5069427rwb; Wed, 21 Sep 2022 02:45:45 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6FnxALk5c7ItNPwUeZ4ck/y4pkd68u+NhO7ElZHvxQnY5CSx8MWHEanx9dTbt6X5xGT04l X-Received: by 2002:a17:907:2e0d:b0:77e:8a08:96d0 with SMTP id ig13-20020a1709072e0d00b0077e8a0896d0mr20236693ejc.378.1663753545202; Wed, 21 Sep 2022 02:45:45 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1663753545; cv=pass; d=google.com; s=arc-20160816; b=jjXIrcEv5n64/pCltuv43VkTUElJHPhuU14q7k9NMkz5ey4vZOY0neXdcD7zymuvK+ OrRFaEakD4Va+1jmrih3mvbUbO3CR70M9G6tsrb4zcj53KIi6kfgI1dw7GF0v4245ohE wFk7KtvfrnK1XahMkpTYCNSSOYRmYD3KJePhwwuRXKBIuxKI58r06xIRTC7As+aBAlc6 YDo6RKvQBRDIpJaRuXy9L+QbmhlW9tLQrVx4NSPe+Msh4KB/371IntVIqvg3leFb/qz4 +E9ZUwzu3xUfwOL9r6m0pqd6h0MUN1vHMsGhltY6gAc29GYdM2UD1nJDN4iw3QKcyks8 VlNg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version:date :subject:message-id:cc:to:from:dkim-signature; bh=1j9B3a9+XvhyGJpimzS54jknD3atX0UsgCNgtn4m3hM=; b=tjDR1ZfIITG4YnvXwT9DAoKef/LxhOeJ+4Oze6akd772yZ/NQC025n7VXX0HXcBCw+ +9K2PsZD8za9hfkpQ0ViTOX2UEy+T3JdHNl0ipbP6CC8EllXyCVViDy1KioCn5dQf5/u T7qS18vZD4QsK3ofYbgLyW23Vo/g0cv3QBTHykRnGqJVViUmnSlxzSzADOE5zMM/SVpm K+FfR++n16rEmmXasYE88lIVKKA22VaWHUkziIOgiQFhtjmIeXVF4zaMi/9j+0BnLgx3 kTdGlFRkKJd4pKaNG9ECyqckZN1xMYPLsWhNjzmXUhUsraVkHQt9hxDwTqfD5kBzpsxL uLyg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@siddh.me header.s=zmail header.b=lGEFgPrP; arc=pass (i=1 spf=pass spfdomain=siddh.me dkim=pass dkdomain=siddh.me dmarc=pass fromdomain=siddh.me>); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siddh.me Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id oz35-20020a1709077da300b007821386a656si1137718ejc.798.2022.09.21.02.45.18; Wed, 21 Sep 2022 02:45:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@siddh.me header.s=zmail header.b=lGEFgPrP; arc=pass (i=1 spf=pass spfdomain=siddh.me dkim=pass dkdomain=siddh.me dmarc=pass fromdomain=siddh.me>); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siddh.me Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231673AbiIUJ3S (ORCPT + 99 others); Wed, 21 Sep 2022 05:29:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49264 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231637AbiIUJ3K (ORCPT ); Wed, 21 Sep 2022 05:29:10 -0400 Received: from sender-of-o50.zoho.in (sender-of-o50.zoho.in [103.117.158.50]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0441B90808; Wed, 21 Sep 2022 02:29:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663752488; cv=none; d=zohomail.in; s=zohoarc; b=DyPkmnbo/DgdALbJ52LApIG2RqgJrBXp54iMKHR2N8joa9qpQH0xRgYMaegejSefqgsnrjqqSx+Ccn1DYBZQIMgs57/eBSvxYvT8bGUksMEXqTTr44+vEoBOw2hBNnFa9ZvmuHeL3UP94yYFRafb5xdMCVyCVdJgSGRiZKT46dc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.in; s=zohoarc; t=1663752488; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:MIME-Version:Message-ID:Subject:To; bh=1j9B3a9+XvhyGJpimzS54jknD3atX0UsgCNgtn4m3hM=; b=PLirgJsQpDyE0sg0mrXKK4V5ji2GKVzgNcrtjvL9sXiI0AajxbNhzX/j0Nhpl3ytH2euBv81fYNVwOcKWhQ/deUZONY69m/tvV4elGfQKHiq0nKSMNC56ptUsBdmF3wIdh/bTefRgRHvdLDYXJh4OVbSXiEzC75gG9zZmaY8f7w= ARC-Authentication-Results: i=1; mx.zohomail.in; dkim=pass header.i=siddh.me; spf=pass smtp.mailfrom=code@siddh.me; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1663752488; s=zmail; d=siddh.me; i=code@siddh.me; h=From:From:To:To:Cc:Cc:Message-ID:Subject:Subject:Date:Date:MIME-Version:Content-Transfer-Encoding:Content-Type:Message-Id:Reply-To; bh=1j9B3a9+XvhyGJpimzS54jknD3atX0UsgCNgtn4m3hM=; b=lGEFgPrPlgUunVg4iRYjjKsEFUFsp368JW4/G7YMvZJPZGPyESa4w1WqZHQb7RsZ igUC8LSnIeOaNuYs2p8WtTP2IFjv1nXx6QF1xaS97Imgr/oWsHsf0LzJ//HxjuzukAu h8RFhBAxxyKlg4kUwWStl0MZNXHn0QNj4mumG74w= Received: from localhost.localdomain (103.240.204.191 [103.240.204.191]) by mx.zoho.in with SMTPS id 1663752487704363.0191740785489; Wed, 21 Sep 2022 14:58:07 +0530 (IST) From: Siddh Raman Pant To: Mauro Carvalho Chehab , Randy Dunlap , David Howells , Jonathan Corbet , "Fabio M. De Francesco" , Eric Dumazet , Christophe JAILLET , Eric Biggers Cc: keyrings , linux-security-module , linux-fsdevel , linux-kernel , linux-kernel-mentees Message-ID: Subject: [RESEND PATCH v2 0/2] watch_queue: Clean up some code Date: Wed, 21 Sep 2022 14:57:44 +0530 X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMailClient: External Content-Type: text/plain; charset=utf8 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org There is a dangling reference to pipe in a watch_queue after clearing it. Thus, NULL that pointer while clearing. This change renders wqueue->defunct superfluous, as the latter is only used to check if watch_queue is cleared. With this change, the pipe is NULLed while clearing, so we can just check if the pipe is NULL. Extending comment for watch_queue->pipe in the definition of watch_queue made the comment conventionally too long (it was already past 80 chars), so I have changed the struct annotations to be kerneldoc-styled, so that I can extend the comment mentioning that the pipe is NULL when watch_queue is cleared. In the process, I have also hopefully improved documentation by documenting things which weren't documented before. Changes in v2: - Merged the NULLing and removing defunct patches. - Removed READ_ONCE barrier in lock_wqueue(). - Improved and fixed errors in struct docs. - Better commit messages. Siddh Raman Pant (2): include/linux/watch_queue: Improve documentation kernel/watch_queue: NULL the dangling *pipe, and use it for clear check include/linux/watch_queue.h | 100 ++++++++++++++++++++++++++---------- kernel/watch_queue.c | 12 ++--- 2 files changed, 79 insertions(+), 33 deletions(-) --=20 2.35.1