]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
rbd-nbd: don't look for cmdline in /proc/[tid] subdirectories
authorMykola Golub <mgolub@suse.com>
Thu, 5 Nov 2020 17:46:19 +0000 (17:46 +0000)
committerMykola Golub <mgolub@suse.com>
Tue, 10 Nov 2020 17:15:59 +0000 (17:15 +0000)
commit746ac7265dd4835998f2d47803d23dc017e0ed69
treed3edfd18b7c1fd1fb0d24b830d979a8d14c3d54d
parent4cda97a8228fa362405bb5a9497731edafcdc3d8
rbd-nbd: don't look for cmdline in /proc/[tid] subdirectories

The proc fs contains both /proc/[pid] and /proc/[tid]
subdirectories. The /proc/[tid] subdirectories are not visible
when listing /proc. But when checking pid for reattached process,
get_mapped_info directly tries to open /proc/[pid]/cmdline, and
it may actually be tid belonging to some other rbd-nbd
process. Try to avoid this by checking /proc/[pid]/comm first --
for pid we expect to find "rbd-nbd" here.

Signed-off-by: Mykola Golub <mgolub@suse.com>
src/tools/rbd_nbd/rbd-nbd.cc