Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 148096 Details for
Bug 228801
NFS race can create persistent stale negative dentries
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Python script to reproduce the bug.
hit_nfs.py (text/plain), 3.10 KB, created by
Fabio Olive Leite
on 2007-02-15 05:37:13 UTC
(
hide
)
Description:
Python script to reproduce the bug.
Filename:
MIME Type:
Creator:
Fabio Olive Leite
Created:
2007-02-15 05:37:13 UTC
Size:
3.10 KB
patch
obsolete
>#!/usr/bin/python > >import os >import posix >import threading >import time > ># BEGIN environment config >local_dir = "/local/foo" >nfs_dir = "/nfs/foo" ># END environment config > >stop_threads = 0 > >def rm_rf(): > "Simulate the recursive removal of the data files in the server side" > os.chdir(local_dir) > try: > os.unlink("bar") > except: > pass > # The first unlink should always fail > try: > os.chdir("bar") > os.chdir("baz") > for i in range(10): > os.unlink("file" + str(i)) > os.chdir("..") > os.rmdir("baz") > os.chdir(local_dir) > os.rmdir("bar") > except: > pass > # I don't think we should care > >def tar(): > "Simulate the untarring of the data files in the server side" > dirs = "bar/baz" > atime = int(time.time()) > mtime = 1167270383; > os.chdir(local_dir) > os.makedirs(dirs, 0755) > for i in range(10): > name = dirs + "/file" + str(i) > fd = posix.open(name, posix.O_WRONLY | posix.O_CREAT | posix.O_EXCL | posix.O_LARGEFILE, 0644) > posix.write(fd, str(i)) > posix.close(fd) > posix.utime(name, (atime, mtime)) > posix.utime(dirs, (atime, 1170209482)) > posix.utime("bar", (atime, 1170134717)) > >def server_side(): > "Alternate removing and restoring the files on the server" > global stop_threads > while not stop_threads: > print "Server-side thread working" > f = os.fork() > if f == 0: > rm_rf() > os._exit(0) > else: > os.waitpid(f, 0) > > f = os.fork() > if f == 0: > tar() > os._exit(0) > else: > os.waitpid(f, 0) > > time.sleep(5) > print "Server-side thread exiting by request" > >def stat_dir(): > "stat the data directory every two seconds" > global stop_threads > #print "stat_dir thread started" > while not stop_threads: > try: > os.stat(nfs_dir + "/bar") > except: > print "Error while stating directory!" > stop_threads = 1 > time.sleep(2) > #print "stat_dir thread exiting by request" > >def stat_file(): > "stat a file in the data directory every two seconds" > global stop_threads > #print "stat_file thread started" > while not stop_threads: > try: > os.stat(nfs_dir + "/bar/baz/file9") > except: > print "Error while stating file!" > stop_threads = 1 > time.sleep(2) > #print "stat_file thread exiting by request" > >def open_dir(): > "open the data directory every two seconds" > global stop_threads > #print "open_dir thread started" > while not stop_threads: > try: > fd = posix.open(nfs_dir + "/bar", posix.O_RDONLY | posix.O_DIRECTORY) > posix.close(fd) > except: > print "Error while opening directory!" > stop_threads = 1 > time.sleep(2) > #print "open_dir thread exiting by request" > ># Start up server thread >server = threading.Thread(target = server_side) >server.start() > ># Start up all client threads >client_threads = [] >for i in range(100): > t = threading.Thread(target = stat_dir) > t.start() > client_threads.append(t) >for i in range(100): > t = threading.Thread(target = stat_file) > t.start() > client_threads.append(t) >for i in range(100): > t = threading.Thread(target = open_dir) > t.start() > client_threads.append(t) >print "All client threads started" > ># Limit run time for debugging purposes >#time.sleep(30) >#stop_threads = 1 > ># Join threads and wait for termination >server.join() >for t in client_threads: > t.join() > >print "All threads stopped, terminating"
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 228801
:
148096
|
148097
|
148440
|
150805
|
157492
|
158367