From: jsg Date: Mon, 27 Sep 2021 03:23:16 +0000 (+0000) Subject: drm: avoid blocking in drm_clients_info's rcu section X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=40694f2c389f3ce3cbe6496a34a5f1d12d6fe5b1;p=openbsd drm: avoid blocking in drm_clients_info's rcu section From Desmond Cheong Zhi Xi 54e51d288b38377e8cd645a83e1ad08cc9d20ccc in linux 5.10.y/5.10.67 5eff9585de220cdd131237f5665db5e6c6bdf590 in mainline linux --- diff --git a/sys/dev/pci/drm/drm_debugfs.c b/sys/dev/pci/drm/drm_debugfs.c index 4d36104fae3..0fb8b2bb8b4 100644 --- a/sys/dev/pci/drm/drm_debugfs.c +++ b/sys/dev/pci/drm/drm_debugfs.c @@ -91,6 +91,7 @@ static int drm_clients_info(struct seq_file *m, void *data) mutex_lock(&dev->filelist_mutex); list_for_each_entry_reverse(priv, &dev->filelist, lhead) { struct task_struct *task; + bool is_current_master = drm_is_current_master(priv); rcu_read_lock(); /* locks pid_task()->comm */ task = pid_task(priv->pid, PIDTYPE_PID); @@ -99,7 +100,7 @@ static int drm_clients_info(struct seq_file *m, void *data) task ? task->comm : "", pid_vnr(priv->pid), priv->minor->index, - drm_is_current_master(priv) ? 'y' : 'n', + is_current_master ? 'y' : 'n', priv->authenticated ? 'y' : 'n', from_kuid_munged(seq_user_ns(m), uid), priv->magic);