[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20061031.231954.23010447.davem@davemloft.net>
Date: Tue, 31 Oct 2006 23:19:54 -0800 (PST)
From: David Miller <davem@...emloft.net>
To: dada1@...mosbay.com
Cc: netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [RFC, PATCH] dont insert sockets/pipes dentries into
dentry_hashtable.
From: Eric Dumazet <dada1@...mosbay.com>
Date: Tue, 31 Oct 2006 19:48:48 +0100
> We currently insert sockets/pipes dentries into the global dentry
> hashtable. This is *useless* because there is currently no way
> these entries can be used for a lookup(). (/proc/xxx/fd/xxx uses a
> different mechanism)
It turns out that while procfs uses a different "mechanism", those
procfs symlinks do point to the real socket dentry, so when you
readlink() on it you do d_path() on the real socket dentry.
If you unhash these things, I'm pretty sure you'll see an ugly
"(deleted)" at the end of the symlink string for /proc/$pid/fd/$X
files that are sockets or something like that.
Al Viro just suggested a way around this to me:
1) Just mark the dentry HASHED by hand in the dentry flags, but don't
actually hash it.
2) Create a special dentry->d_deleted method for sockets that returns
0 and clears by hand the HASHED flag bit in the dentry (see what
dput() does when this happens).
It's an abuse but it will work.
-
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