OSDN Git Service

[PATCH] dcache: avoid race when updating nr_unused count of unused dentries
authorNeilBrown <neilb@cse.unsw.edu.au>
Tue, 29 Nov 2005 12:04:13 +0000 (13:04 +0100)
committerMarcelo Tosatti <marcelo@dmt.cnet>
Fri, 9 Dec 2005 17:35:10 +0000 (15:35 -0200)
commit55a2bfb79d5c6d9cb2aed3419c8d6c02a30d3cc8
tree5fb83046e944f230da5e18bdf570df2891a43ca1
parent43c6ce6dc78fb89f96afc2197e0703303e660154
[PATCH] dcache: avoid race when updating nr_unused count of unused dentries

 ChangeSet
   2004/05/29 10:58:56-07:00 akpm@osdl.org
   [PATCH] fs/dcache.c: avoid race when updating nr_unused count of unused dentries.

   From: NeilBrown <neilb@cse.unsw.edu.au>

   d_count == 1 is no guarantee that dentry is on the dentry_unused list, even
   if it has just been incremented inside dcache_lock, as dput can decrement
   at any time.

   This test from Greg Banks is much safer, and is more transparently correct.

Cc: Maneesh Soni <maneesh@in.ibm.com>, Dipankar Sarma <dipankar@in.ibm.com>
   From: Greg Banks <gnb@melbourne.sgi.com>
Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
fs/dcache.c