public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* 3.12 Regression: dcache: Translating dentry into pathname without taking rename_lock 232d2d60
@ 2013-11-13 11:34 Michael Marineau
  2013-11-13 12:39 ` Al Viro
  0 siblings, 1 reply; 9+ messages in thread
From: Michael Marineau @ 2013-11-13 11:34 UTC (permalink / raw)
  To: Waiman Long; +Cc: linux-kernel, Al Viro

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])

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2013-11-22 19:46 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-13 11:34 3.12 Regression: dcache: Translating dentry into pathname without taking rename_lock 232d2d60 Michael Marineau
2013-11-13 12:39 ` Al Viro
2013-11-13 14:49   ` Long, Wai Man
2013-11-13 22:51   ` Michael Marineau
2013-11-21 23:01     ` Greg KH
2013-11-21 23:16       ` Michael Marineau
2013-11-22 19:45         ` Greg KH
2013-11-21 23:22       ` Al Viro
2013-11-22 19:45         ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox