All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ming Lei <ming.lei@redhat.com>
To: Seamus Connor <sconnor@purestorage.com>
Cc: Jens Axboe <axboe@kernel.dk>,
	linux-block@vger.kernel.org,
	Caleb Sander Mateos <csander@purestorage.com>
Subject: Re: [PATCH v2] ublk: fix ublksrv pid handling for pid namespaces
Date: Tue, 13 Jan 2026 11:47:58 +0800	[thread overview]
Message-ID: <aWXAbhyzVvyCuqBQ@fedora> (raw)
In-Reply-To: <CAB5MrP5mezn9rWZmykXTcc5-kLRPScu79xQsd_4Q7L=X=hn6dQ@mail.gmail.com>

On Mon, Jan 12, 2026 at 06:46:06PM -0800, Seamus Connor wrote:
> > `ublksrv_pid` is from userspace, so it may be invalid, then you may have to
> > check result of find_vpid().
> 
> find_vpid() returns either a valid struct pid* or NULL as far as I
> understand, and pid_nr handles the case where the provided struct pid*
> is NULL. Is there another case to handle that I am missing?

pid_nr(NULL) returns 0, but the stored ->ublksrv_pid can't be zero, so this
bad condition is always covered?  If yes, looks it is fine to not check
NULL `pid*` explicitly.


Thanks,
Ming


  reply	other threads:[~2026-01-13  3:48 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-11  0:00 [PATCH] ublk: fix ublksrv pid handling for pid namespaces Seamus Connor
2026-01-12  5:40 ` Ming Lei
2026-01-12 18:09   ` Seamus Connor
2026-01-12 22:56 ` [PATCH v2] " Seamus Connor
2026-01-13  2:01   ` Ming Lei
2026-01-13  2:46     ` Seamus Connor
2026-01-13  3:47       ` Ming Lei [this message]
2026-01-13 23:03         ` Seamus Connor
2026-01-14  3:55           ` Ming Lei
2026-01-14 20:47   ` [PATCH v3] " Seamus Connor
2026-01-15  1:48     ` Ming Lei
2026-01-15  2:59 ` [PATCH v4] " Seamus Connor
2026-01-20 23:48   ` Seamus Connor
2026-01-21 14:45   ` Jens Axboe
2026-01-21 14:48   ` Jens Axboe

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=aWXAbhyzVvyCuqBQ@fedora \
    --to=ming.lei@redhat.com \
    --cc=axboe@kernel.dk \
    --cc=csander@purestorage.com \
    --cc=linux-block@vger.kernel.org \
    --cc=sconnor@purestorage.com \
    /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.