3.12 Regression: dcache: Translating dentry into pathname withouttaking rename_lock 232d2d60

From: Michael Marineau
Date: Wed Nov 13 2013 - 06:34:18 EST


Greetings,

Commit 232d2d60aa5469bb097f55728f65146bd49c1d25 causes intermittent
errors in /proc/*/fd/* where readlink returns "/" instead of the
correct path. This can be reproduced by the script below which copies
the kernel source directory structure while obsessively looking up
directory fds in proc from another process. Reverting
232d2d60aa5469bb097f55728f65146bd49c1d25 after two related commits
48f5ec21d9c67e881ff35343988e290ef5cf933f
1812997720ab90d029548778c55d7315555e1fef fixes the issue.

Cheers,
Mike


#!/usr/bin/python

import os
import subprocess
import tempfile

KERNEL_SOURCE="/home/marineam/git/linux"
TEMP_DIR=tempfile.mkdtemp()

# Copy the directory tree, can skip most of the files
rsync = subprocess.Popen(["rsync", "--exclude=*.*", "-a",
KERNEL_SOURCE, TEMP_DIR])

def check_entry(dir_path, name):
expect = "%s/%s" % (dir_path, name)
if os.path.islink(expect):
return

fd = os.open(expect, os.O_RDONLY)
# It takes some pounding on proc to be likely to hit an error
for i in xrange(100):
got = os.readlink("/proc/self/fd/%d" % fd)
if got != expect:
print "Got %s instead of %s" % (got, expect)

os.close(fd)

try:
for dirpath, dirnames, filenames in os.walk(KERNEL_SOURCE):
for name in dirnames:
check_entry(dirpath, name)
finally:
rsync.wait()
subprocess.call(["rm", "-rf", TEMP_DIR])
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/