sk-unix: allocate FdinfoEntry with shmalloc in get_fle_for_task

We already do so in other branch of if in dup_fdinfo, let's then do it
symmetrically. We later put pointer to this FdinfoEntry in collect_fd_to
int alloc_fle to fdinfo_list_entry->fe so it can be later used from
other places and if one thread modifies it we would not see modification
in other threads.

Do we really need to see these modifications? - It's Mistery, but better
be on the safe side.

Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>

(cherry picked from commit 376773c840e1b527f894e83048f0be61869c409a)
Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@futurfusion.io>
This commit is contained in:
Pavel Tikhomirov 2022-12-14 14:23:55 +03:00 committed by Alexander Mikhalitsyn
parent 3a08a23b13
commit 467ea87e0c

View file

@ -1095,7 +1095,7 @@ static struct fdinfo_list_entry *get_fle_for_task(struct file_desc *tgt, struct
* we need to ... invent a new one!
*/
e = xmalloc(sizeof(*e));
e = shmalloc(sizeof(*e));
if (!e)
return NULL;