RDMA/core: Check that process is still alive before sending it to the users
authorLeon Romanovsky <leonro@mellanox.com>
Thu, 10 Oct 2019 07:11:05 +0000 (10:11 +0300)
committerJason Gunthorpe <jgg@mellanox.com>
Wed, 23 Oct 2019 19:02:12 +0000 (16:02 -0300)
commitac71ffcfb457a98f0386d682de107ef746bcb60e
tree0ffcd6f2b94646de798a28533ce2e74269f1987f
parentcf7e93c12fbc0f18cbea0571406e302d6904a7ac
RDMA/core: Check that process is still alive before sending it to the users

The PID information can disappear asynchronously because the task can be
killed and moved to zombie state. In this case, PID will be zero in
similar way to the kernel tasks. Recognize such situation where we are
asking to return orphaned object and simply skip filling PID attribute.

As part of this change, document the same scenario in counter.c code.

Link: https://lore.kernel.org/r/20191010071105.25538-3-leon@kernel.org
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Reviewed-by: Jason Gunthorpe <jgg@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/core/counters.c
drivers/infiniband/core/nldev.c