* [PATCH] replace hack with dget/mntget usage in fs/dcookies.c
@ 2005-09-01 8:04 Kirill Korotaev
2005-09-01 8:38 ` Andrew Morton
0 siblings, 1 reply; 2+ messages in thread
From: Kirill Korotaev @ 2005-09-01 8:04 UTC (permalink / raw)
To: linux-kernel, Linus Torvalds, Andrew Morton
[-- Attachment #1: Type: text/plain, Size: 341 bytes --]
This patch replaces manual incrementing of refcounters on dentry/mnt in
fs/dcookie.c with calls to dget()/mntget().
Noticed this when tried to change logic in dget() and it began to oops.
Signed-Off-By: Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>
Signed-Off-By: Pavel Emelianov <xemul@sw.ru>
Signed-Off-By: Kirill Korotaev <dev@sw.ru>
Kirill
[-- Attachment #2: diff-fs-dcookie-20050823 --]
[-- Type: text/plain, Size: 483 bytes --]
--- linux-2.6.8.1-t032/fs/dcookies.c.dget 2004-08-14 14:54:46.000000000 +0400
+++ linux-2.6.8.1-t032/fs/dcookies.c 2005-08-23 14:09:00.000000000 +0400
@@ -93,12 +93,10 @@ static struct dcookie_struct * alloc_dco
if (!dcs)
return NULL;
- atomic_inc(&dentry->d_count);
- atomic_inc(&vfsmnt->mnt_count);
dentry->d_cookie = dcs;
- dcs->dentry = dentry;
- dcs->vfsmnt = vfsmnt;
+ dcs->dentry = dget(dentry);
+ dcs->vfsmnt = mntget(vfsmnt);
hash_dcookie(dcs);
return dcs;
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] replace hack with dget/mntget usage in fs/dcookies.c
2005-09-01 8:04 [PATCH] replace hack with dget/mntget usage in fs/dcookies.c Kirill Korotaev
@ 2005-09-01 8:38 ` Andrew Morton
0 siblings, 0 replies; 2+ messages in thread
From: Andrew Morton @ 2005-09-01 8:38 UTC (permalink / raw)
To: Kirill Korotaev; +Cc: linux-kernel, torvalds
Kirill Korotaev <dev@sw.ru> wrote:
>
> This patch replaces manual incrementing of refcounters on dentry/mnt in
> fs/dcookie.c with calls to dget()/mntget().
>
> ...
>
> --- linux-2.6.8.1-t032/fs/dcookies.c.dget 2004-08-14 14:54:46.000000000 +0400
> +++ linux-2.6.8.1-t032/fs/dcookies.c 2005-08-23 14:09:00.000000000 +0400
Whoa. Medieval kernel.
> @@ -93,12 +93,10 @@ static struct dcookie_struct * alloc_dco
> if (!dcs)
> return NULL;
>
> - atomic_inc(&dentry->d_count);
> - atomic_inc(&vfsmnt->mnt_count);
> dentry->d_cookie = dcs;
>
> - dcs->dentry = dentry;
> - dcs->vfsmnt = vfsmnt;
> + dcs->dentry = dget(dentry);
> + dcs->vfsmnt = mntget(vfsmnt);
> hash_dcookie(dcs);
>
> return dcs;
That's already there.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2005-09-01 8:40 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-09-01 8:04 [PATCH] replace hack with dget/mntget usage in fs/dcookies.c Kirill Korotaev
2005-09-01 8:38 ` Andrew Morton
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox