]> git.hungrycats.org Git - linux/commit
[PATCH] real_lookup race fix
authorAndrew Morton <akpm@digeo.com>
Thu, 3 Apr 2003 00:28:49 +0000 (16:28 -0800)
committerLinus Torvalds <torvalds@home.transmeta.com>
Thu, 3 Apr 2003 00:28:49 +0000 (16:28 -0800)
commit1b8910cf1042f2de2cdd1dc26e4fb677b6dad7ed
tree4869548e516c1b664562254e3ef3293d4ffcbcdd
parentec1d26ecbdb12455aad940832ed88503af46131d
[PATCH] real_lookup race fix

From: Maneesh Soni <maneesh@in.ibm.com>

Here is a patch to use seqlock for real_lookup race with d_lookup as suggested
by Linus. The race condition can result in duplicate dentry when d_lookup
fails due concurrent d_move in some unrelated directory.

Apart from real_lookup, lookup_hash()->cached_lookup() can also fail due
to same reason. So, for that I am doing the d_lookup again.

Now we have __d_lookup (called from do_lookup() during pathwalk) and
d_lookup which uses seqlock to protect againt rename race.

dcachebench numbers (lower is better) don't have much difference on a 4-way
PIII xeon SMP box.

base-2565
Average usec/iteration  19059.4
Standard Deviation      503.07

base-2565 + seq_lock
Average usec/iteration  18843.2
Standard Deviation      450.57
fs/dcache.c
fs/namei.c
include/linux/dcache.h