All of lore.kernel.org
 help / color / mirror / Atom feed
From: Siddh Raman Pant <code@siddh.me>
To: Mauro Carvalho Chehab <mchehab@kernel.org>,
	Randy Dunlap <rdunlap@infradead.org>,
	David Howells <dhowells@redhat.com>,
	Jonathan Corbet <corbet@lwn.net>,
	"Fabio M. De Francesco" <fmdefrancesco@gmail.com>,
	Eric Dumazet <edumazet@google.com>,
	Christophe JAILLET <christophe.jaillet@wanadoo.fr>,
	Eric Biggers <ebiggers@kernel.org>
Cc: keyrings <keyrings@vger.kernel.org>,
	linux-security-module <linux-security-module@vger.kernel.org>,
	linux-fsdevel <linux-fsdevel@vger.kernel.org>,
	linux-kernel <linux-kernel@vger.kernel.org>
Subject: [RESEND PATCH v2 0/2] watch_queue: Clean up some code
Date: Sat, 12 Nov 2022 16:00:39 +0530	[thread overview]
Message-ID: <cover.1668248462.git.code@siddh.me> (raw)

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(-)

-- 
2.35.1



             reply	other threads:[~2022-11-12 10:48 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-12 10:30 Siddh Raman Pant [this message]
2022-11-12 10:30 ` [RESEND PATCH v2 1/2] include/linux/watch_queue: Improve documentation Siddh Raman Pant
2022-11-12 10:30 ` [RESEND PATCH v2 2/2] kernel/watch_queue: NULL the dangling *pipe, and use it for clear check Siddh Raman Pant
2022-11-28 10:36 ` [RESEND PATCH v2 0/2] watch_queue: Clean up some code Siddh Raman Pant
  -- strict thread matches above, loose matches on Subject: below --
2022-09-21  9:27 Siddh Raman Pant
2022-09-21  9:27 ` Siddh Raman Pant via Linux-kernel-mentees
2022-09-01 20:06 Siddh Raman Pant via Linux-kernel-mentees
2022-09-01 20:06 ` Siddh Raman Pant via Linux-kernel-mentees
2022-09-01 20:06   ` Siddh Raman Pant

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cover.1668248462.git.code@siddh.me \
    --to=code@siddh.me \
    --cc=christophe.jaillet@wanadoo.fr \
    --cc=corbet@lwn.net \
    --cc=dhowells@redhat.com \
    --cc=ebiggers@kernel.org \
    --cc=edumazet@google.com \
    --cc=fmdefrancesco@gmail.com \
    --cc=keyrings@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=rdunlap@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.