[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3ae72650708050700p1fc2959epcc1e9307e3c64fed@mail.gmail.com>
Date: Sun, 5 Aug 2007 16:00:08 +0200
From: "Kay Sievers" <kay.sievers@...y.org>
To: "Alexey Dobriyan" <adobriyan@...il.com>,
"Tejun Heo" <htejun@...il.com>
Cc: akpm@...l.org, gregkh@...e.de, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] Off-by-one in /sys/module/*/refcnt
On 8/5/07, Alexey Dobriyan <adobriyan@...il.com> wrote:
> Hell knows when this changed, but sysfs is lying about modules refcounts now.
>
> $ cat /sys/module/it87/refcnt
> 4294967295
> $ lsmod | grep ^it87
> it87 15756 0
>
> Signed-off-by: Alexey Dobriyan <adobriyan@...il.com>
> ---
>
> kernel/module.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> --- a/kernel/module.c
> +++ b/kernel/module.c
> @@ -785,7 +785,7 @@ static ssize_t show_refcnt(struct module_attribute *mattr,
> struct module *mod, char *buffer)
> {
> /* sysfs holds a reference */
> - return sprintf(buffer, "%u\n", module_refcount(mod)-1);
> + return sprintf(buffer, "%u\n", module_refcount(mod));
> }
It's likely caused by sysfs core changes, that opened attributes are
no longer coupled to the refcount of modules. They used to take a
reference.
The "holds a reference" comment should be removed along with your fix.
Adding Tejun, to confirm this.
Thanks,
Kay
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists