]> git.hungrycats.org Git - linux/commit
[PATCH] fs/dcache.c: avoid race when updating nr_unused count of unused dentries.
authorAndrew Morton <akpm@osdl.org>
Sat, 29 May 2004 03:58:56 +0000 (20:58 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Sat, 29 May 2004 03:58:56 +0000 (20:58 -0700)
commitec9b8ac0808cdcb30c1a34687ad4e9036db60b15
tree486fb97243034740aa161d4c7dd21f3669bc77d3
parent7cd50e492dd69a153a8dfb9eaaf957457a84c373
[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