On 7/20/2025 12:00 AM, Markus Elfring wrote:
+++ b/drivers/hv/mshv_vtl_main.c
@@ -0,0 +1,1783 @@
+static int mshv_vtl_sint_ioctl_set_eventfd(struct mshv_vtl_set_eventfd __user 
*arg)
+{
+       mutex_lock(&flag_lock);
+       old_eventfd = flag_eventfds[set_eventfd.flag];
+       WRITE_ONCE(flag_eventfds[set_eventfd.flag], eventfd);
+       mutex_unlock(&flag_lock);
…

Under which circumstances would you become interested to apply a statement
like “guard(mutex)(&flag_lock);”?
https://elixir.bootlin.com/linux/v6.16-rc6/source/include/linux/mutex.h#L225

Regards,
Markus

I didn't know about it, TBH. I will use it in this driver in all places.
I have tested the same in my setup.

Thanks.

Regards,
Naman

Reply via email to