Re: [PATCH v6 05/20] liveupdate: luo_ioctl: add user interface

From: David Matlack

Date: Thu Nov 20 2025 - 13:38:13 EST


On Sat, Nov 15, 2025 at 3:34 PM Pasha Tatashin
<pasha.tatashin@xxxxxxxxxx> wrote:
> The idea is that there is going to be a single userspace agent driving
> the live update, therefore, only a single process can ever hold this
> device opened at a time.
...
> +static int luo_open(struct inode *inodep, struct file *filep)
> +{
> + struct luo_device_state *ldev = container_of(filep->private_data,
> + struct luo_device_state,
> + miscdev);
> +
> + if (atomic_cmpxchg(&ldev->in_use, 0, 1))
> + return -EBUSY;

Can you remind me why the kernel needs to enforce this? What would be
wrong or unsafe from the kernel perspective if there were multiple
userspace agents holding open files for /dev/liveupdate, each with
their own sessions?