Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp3288404rwb; Sat, 12 Nov 2022 02:58:53 -0800 (PST) X-Google-Smtp-Source: AA0mqf7oet7DuyBnF+Vgu/Cy9+X8pV4SGANQQH2E07w/nBKJIMQCRS16tYTTZ1Zs0kj8vP3hSuP4 X-Received: by 2002:aa7:90cf:0:b0:563:4643:db33 with SMTP id k15-20020aa790cf000000b005634643db33mr6488107pfk.22.1668250733117; Sat, 12 Nov 2022 02:58:53 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1668250733; cv=pass; d=google.com; s=arc-20160816; b=OQTYeSiwHDwzg9JiFCXi0sD/9Q0ZB9R9Z2uQSmw3AFGCzCtd961hQx5DrM2spJ5vq4 smMueeDNzyBL6f7wXa9KkIt6xioyYsZJav+WlrKPxoinNbLTMT9rk6iQjRMbv8CnJHkX bT6WxSu5RWs/TXvKpCsdO7aqVLifzX7nT4Ekw/8YukC32X7QJ5zkxSO8iMVsOeRj/wtj O2++C4Jg1Nzd1blI2fDgDJVo4Wu+2RbQYYgc6kv5cgYTzk1n1qJwIZvddJUNqsrVfuee 4AUdeALm+zh9rbz/ALDqZ7kDLKH8ISzHvdVNqZzzGxHyQxtcC4E/Y1+SUdgpR902Rdtv 952w== 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=BCGeylOFJYtUpHot+ky277Ye6xqHBGluvEQQ9Xbj6Mg=; b=yJ3K1A/sQolXHAm7LejXULWY48TqJYOrWoAspMzcFB0c34IaV71uWAQCbk/28XTRAt sP29K06ZgHJxhsHXFvJSIxbJFdJGHftBpoxOdjESH8TXaS9KWkIF0vEiH5/DJQRIJCR3 +3PW+CGmekzdgeeF0BMZo78v/030rBHo6XyFkIv68kR7H2HaDTGD7iHQyufMijTPL9Po O/xrsqyy/MUgqt7UOyYTdo04b27UlfAuKEuafLdrxNzjIfZiFX5IAnrroJXh1+x6dUYX OQhEQdOB9jGsetugapUlOoI1AkG4oj3eRlSCCqX+JwBIQl02R8UeZmoVTXj8NPmCj2Nu VgPA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@siddh.me header.s=zmail header.b=PozslzT7; 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 m189-20020a6326c6000000b0046eb1d42b66si4794670pgm.284.2022.11.12.02.58.41; Sat, 12 Nov 2022 02:58:53 -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=PozslzT7; 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 S233989AbiKLKs7 (ORCPT + 92 others); Sat, 12 Nov 2022 05:48:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55076 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234802AbiKLKsz (ORCPT ); Sat, 12 Nov 2022 05:48:55 -0500 X-Greylist: delayed 94 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Sat, 12 Nov 2022 02:48:53 PST Received: from sender-of-o50.zoho.in (sender-of-o50.zoho.in [103.117.158.50]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EDA0E1704A; Sat, 12 Nov 2022 02:48:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668249051; cv=none; d=zohomail.in; s=zohoarc; b=LFqAfRynvUXCUpErtnOL6NDnj4CYj8iUanwK1DI2pR+ycJNXJzAwqaHIZmzZOgUIt02nNaJBMnJmhKGlIruks6xnjLYgWeI0U4bgegcQS0Or9DXN0OOsU+fJ6BR29aBMM7qz/NUICVDPdVbsW5J5hNoQ4dphep8ZwHCZ/uLWJIQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.in; s=zohoarc; t=1668249051; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:MIME-Version:Message-ID:Subject:To; bh=BCGeylOFJYtUpHot+ky277Ye6xqHBGluvEQQ9Xbj6Mg=; b=KNmJaKaRXLHJy2ps9hY+5dEQrg7iBmOw45HEscaazRCJAfFomGO/z3zFitv7w/OjVJjJ+W051G3AAH3Lp+rabtrQ2INaCv0/gHYL6kWKDmHOsy0Ted8tGhIMGA7fplxTjmw4YnAdviF6+UyCjf4Aiavc6a7Nuk/esNNph2AO7Wc= 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=1668249051; 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=BCGeylOFJYtUpHot+ky277Ye6xqHBGluvEQQ9Xbj6Mg=; b=PozslzT7pVPO2qvIFATO1I96o2g8GSKMsxdghJMy8CfbfKGTpVvE6px9WGHEOunY HVzWfULbawSa5IR8qvhULazw3+TmhelCBIQbApNmSWHqGS3X9VbMmUiD7zzA8gBozNo 3SaZNtO27VhwOcopImrs34fC1d/Kje44T4HTcxTE= Received: from kampyooter.. (110.226.30.173 [110.226.30.173]) by mx.zoho.in with SMTPS id 166824904951082.6955736246938; Sat, 12 Nov 2022 16:00:49 +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: [RESEND PATCH v2 0/2] watch_queue: Clean up some code Date: Sat, 12 Nov 2022 16:00:39 +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. Original date of posting patch: 6 Aug 2022 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