Received: by 2002:ac0:e350:0:0:0:0:0 with SMTP id g16csp308652imn; Thu, 4 Aug 2022 06:52:32 -0700 (PDT) X-Google-Smtp-Source: AA6agR5dMaUS66Yjsiv6NeyAx/o2GrFPX9NIW2v8Igk7qd25Fwjezzn5vIr9BuKVG5AmdXqCs+Eg X-Received: by 2002:a17:907:3f90:b0:72b:859e:8fdc with SMTP id hr16-20020a1709073f9000b0072b859e8fdcmr1514086ejc.735.1659621151789; Thu, 04 Aug 2022 06:52:31 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1659621151; cv=pass; d=google.com; s=arc-20160816; b=obX+spZvaw+07uDD9UmMsRJoCC4CqJOM4KsMfyTMMM5NNOcBzJbY5WeT/Q+2qlHdcG pK7fYA0FNisBqER76mitTIUcQ1bZOnzLWAJ32KlJt7WASIqhcM0JphUqNcatRDBFnT/M KRmOio5Gs4JZTm0YmmTw6vdDppqSBdIQkAhmbSnrc8SrCidytx3NFQN+jRO6GTIyp9wa 5G2BePq3gQhMD3fF1X3q+AwbvS9/NaZT1Xuw2MVtAA0DY3VX3RgV6EJaAcoyyYq8TmUL PPBag0qRVyQvaOQqMdgmXTIY0nPZySJqVOsnl0md9oR/2FVhNoDqBiWRBVRaUkkr8Lrt /Blw== 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=Mkouf4SEWTVHaF7w1SKVoF67Ydf5Jf61GjhuLviyvJI=; b=VpnWF0IRA/VUxORnwPKxwHl040tyT+Ocul+a+vE1it0Rhc1vyFKuSUDKmPFjVbL1tY QAS548g/UJPlKUpg62ieY9shpgG/OJt/k3+/b+iV3mvWS9nyJkN/t4cwROV9XT9LfUtz kI0XCOjZD1L3wqhBT0ozMfhMhtwZylOys4BGKuCXiR0KtS+hLz/1gDun1FwaYH/h75R1 ieuZbRVO9ldeHNRJTniHmetGrwD4Ftfr51AsdilqZEimd0eODHVAI7nuH+llDpCJWX3z abgc052MLOrH7YEHYc5hYlBZnBv5HxU8MsH+gNHjMXq049/Q30VYkYFu/Z/ObGeRmjwk GQrA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@siddh.me header.s=zmail header.b=Vyp62Aw6; 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 fb17-20020a1709073a1100b0072f1f41bf94si807633ejc.244.2022.08.04.06.52.06; Thu, 04 Aug 2022 06:52:31 -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=Vyp62Aw6; 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 S239846AbiHDNcG (ORCPT + 99 others); Thu, 4 Aug 2022 09:32:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36780 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239833AbiHDNcE (ORCPT ); Thu, 4 Aug 2022 09:32:04 -0400 Received: from sender-of-o53.zoho.in (sender-of-o53.zoho.in [103.117.158.53]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 52B7D3D5AF for ; Thu, 4 Aug 2022 06:31:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659619868; cv=none; d=zohomail.in; s=zohoarc; b=SZw+8XMbXUhCC9M5zws+UTT4BnqMIiledxtl9zcqM91/pPLeB1UzprgJoS+bXuMSxmjVR/0lTawbBopGawupmsXMbgrse4H0Ty0a3g4ql76W/5ykBkw0P9S3/1JT1JeTdQIAhjdGlVJtfqmpb5cLpJ+dRkHWytGyyqAGbxpMNPo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.in; s=zohoarc; t=1659619868; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:MIME-Version:Message-ID:Subject:To; bh=Mkouf4SEWTVHaF7w1SKVoF67Ydf5Jf61GjhuLviyvJI=; b=f1CWY6eayz5V5C9qgyTnEBauougLevVyN+HAyBc1ycM5g3+oddudC54vSThdy/VAxGansevU66EONexIyeD9/t04T8ANaNiteOEoedk0HnYKuhnhMWvSAx9MXQDsqwPIZdOjcaqEfAWxMU3lp7JyrgMJgtoS24QYE3Sf/jE7xcw= 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=1659619868; 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=Mkouf4SEWTVHaF7w1SKVoF67Ydf5Jf61GjhuLviyvJI=; b=Vyp62Aw68XEUvrRYpXNy938pR6kpxx37ANsObBuIItdFBuDtb+PFlHVe44b8dllE ESyFabbj6UnW/wnj6WsSrH5dZUZmtSfQVVttL2R135evsr901ge8kBxEsSPUzHiK+XO XkvyHCxv2TcJrSnCVhsKfgGBq1CuxbHDSZZnAJpQ= Received: from localhost.localdomain (103.250.137.206 [103.250.137.206]) by mx.zoho.in with SMTPS id 1659619866703572.7773396291667; Thu, 4 Aug 2022 19:01:06 +0530 (IST) From: Siddh Raman Pant To: Eric Biggers , Jonathan Corbet , David Howells , Randy Dunlap , Mauro Carvalho Chehab , Christophe JAILLET , Eric Dumazet Cc: linux-kernel , linux-kernel-mentees Message-ID: Subject: [PATCH 0/3] kernel/watch_queue: Clean up some code Date: Thu, 4 Aug 2022 19:00:21 +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,URIBL_RED 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 can be thought of as a v4 of the patches I had sent earlier. 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 NULL'd 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 doxygen-styled, so that I can extend the comment mentioning that the pipe is NULL when watch_queue is cleared. Siddh Raman Pant (3): kernel/watch_queue: Remove dangling pipe reference while clearing watch_queue kernel/watch_queue: Improve struct annotation formatting kernel/watch_queue: Remove wqueue->defunct and use pipe for clear check include/linux/watch_queue.h | 95 +++++++++++++++++++++++++++---------- kernel/watch_queue.c | 11 ++--- 2 files changed, 75 insertions(+), 31 deletions(-) --=20 2.35.1