提交 4b998d4f 编写于 作者: E Eric W. Biederman 提交者: Linus Torvalds

[PATCH] sysctl: cdrom: don't set de->owner

There is no need for open files in /proc/sys/XXX to hold a reference count on
the module that provides the file to prevent module unload races.  While there
is code active in the module p->used in the sysctl_table_header is
incremented, preventing the sysctl from being unregisted.  Once the sysctl is
unregistered it cannot be found.  Open files are also not a problem as they
revalidate the sysctl information and bump p->used before accessing module
code.

So setting de->owner is unnecessary, makes for a bad example and gets in my
way of removing ctl_table->de.
Signed-off-by: NEric W. Biederman <ebiederm@xmission.com>
Acked-by: NJens Axboe <jens.axboe@oracle.com>
Acked-by: NJames Bottomley <James.Bottomley@SteelEye.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 208367ee
......@@ -3554,8 +3554,6 @@ static void cdrom_sysctl_register(void)
return;
cdrom_sysctl_header = register_sysctl_table(cdrom_root_table, 0);
if (cdrom_root_table->ctl_name && cdrom_root_table->child->de)
cdrom_root_table->child->de->owner = THIS_MODULE;
/* set the defaults */
cdrom_sysctl_settings.autoclose = autoclose;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册