Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp4763557rwl; Sun, 8 Jan 2023 02:51:40 -0800 (PST) X-Google-Smtp-Source: AMrXdXt+dGVuetCjoOwGa+wAFppMJESDEA6i0T/8X+NaDHlL+J9raQW8S1gU/VSwn6yNGGgUL13K X-Received: by 2002:a17:907:8193:b0:84d:4325:7f7a with SMTP id iy19-20020a170907819300b0084d43257f7amr899652ejc.65.1673175100015; Sun, 08 Jan 2023 02:51:40 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1673175099; cv=pass; d=google.com; s=arc-20160816; b=Urwt5sTtlh4iZPk3bzrmcBGjrplCkYM2ZulVOPROakpmYERp2ICtOJ2gE63H99p0B/ pyFhvQOm/5fAHoM+xymtcoPmitiuGNDjc+ftQ3t9T6SustygiB6sPHswVwFT7Z5ZGILG fY9FV/+U70xq6w51Q0dR7+hzppM5AJxzLIT7fDMLpIGxEgc6QDUE2fmbJ+hpNhMjBdJf zZ7F2Ttkm3YKBOBtGXqQra+WhtGesJlKFLWm9DL2V7ARcNHNAtK5xBkyhUKYg4J118DW C8vkGoUNiduB9cLv9y9835Z3t82GLUvw5/U0SAeWV2ItsTnter7HRMkKdytkB2Jt25Jb 8CGA== 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=pcXt8bFzKFZCxe/K2x0CZ6wr09PH7+KBAfFhihnTjHU=; b=iuipenQZSWKd5YpasLZndob0gglm1seYkKYhWjyxLjxl/BaLr8PS5fgjTv4EHRzP3Y /75esxcZ84hJSVJ8/MLuhNWitGAgsl8HU52OXv+JfiAgrSXYMd8fH6b8UV6idtcfb6Pv W07/Ssxtdovu+oE43hV4mkVSGamU2+zP80kBa2JwoiWdjl0XRMTysPda49Fg8opU6Zms Qqt+h3iRAgUEZ1hZpbzXA3LZ6oKDmWoKS0vQuwghYOZuykfB7IJIMU1YDzpCGCWKRG1R LyhbPv8YcEt033peYYLS5LZ5MkKeokBGXMi0Tfe5YWJY8Qn2jbhlQnYtqN1zfWuaFC6i gTWQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@siddh.me header.s=zmail header.b=MyiAs1b9; 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 qo14-20020a170907874e00b0077951929340si5119554ejc.271.2023.01.08.02.51.27; Sun, 08 Jan 2023 02:51:39 -0800 (PST) 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=MyiAs1b9; 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 S233040AbjAHKho (ORCPT + 53 others); Sun, 8 Jan 2023 05:37:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36346 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231454AbjAHKhe (ORCPT ); Sun, 8 Jan 2023 05:37:34 -0500 Received: from sender-of-o50.zoho.in (sender-of-o50.zoho.in [103.117.158.50]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 93CDFE0B9; Sun, 8 Jan 2023 02:37:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673174207; cv=none; d=zohomail.in; s=zohoarc; b=R4sR6HypQhsq0FANUSSfT92ZwhHFDchRxsFIGEqe4+EA8pC9qA2wUtwkh8Kw1iMhCdTIsRsP/mK9je1Z9PNCidJP04cxYDGkoNQ3v5z4rAJSirhFGN1EmBrpik2seKCiS0NvPigLMLU4NpUqmwe3/2ZxL5CnZxwFdGvSvmkOOJg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.in; s=zohoarc; t=1673174207; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:MIME-Version:Message-ID:Subject:To; bh=pcXt8bFzKFZCxe/K2x0CZ6wr09PH7+KBAfFhihnTjHU=; b=V7u4OWXFpp4PlPYvEEKPtTBJGA2E3Ov6tJxkWSOT4sq1LQS+aIy9WwTx0h2d5BIrfN1TtaC58A6CnZB/HopVk0+LF/dUY1KLoEZoTaHNpLRFh57Q8NForv76xHyze0DR/CWDcQnCx6VBkkCxdCPpzr7ckl8lf1u/rVQd6kOVTI4= 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=1673174207; 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=pcXt8bFzKFZCxe/K2x0CZ6wr09PH7+KBAfFhihnTjHU=; b=MyiAs1b9XVjh7OyDI6QRNFE/1Zxtc78eCokPbQL8L+SA9D0hwRszQaPPS2+vg+Au yEHFVV70X1V0pihDEzq9txLwGCHl8IAx0Esw2lVcvkZ7ygLF8/EQxuq4j615gedgax/ ew1b4vxtQrp2jksCg/e5cnOZJss4nxEvg3aEQd9o= Received: from kampyooter.. (110.226.31.37 [110.226.31.37]) by mx.zoho.in with SMTPS id 1673174205063602.2424519389933; Sun, 8 Jan 2023 16:06:45 +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 Message-ID: Subject: [PATCH v3 0/2] watch_queue: Clean up some code Date: Sun, 8 Jan 2023 16:06:30 +0530 X-Mailer: git-send-email 2.39.0 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 v3: - Fixed misplaced/incorrect comment for members watch_list and list_node in struct watch. - Minor rephrase of comment before NULLing in watch_queue_clear(). Changes in v2 (6 Aug 2022): - 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.39.0