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 610824 Details for
Bug 842312
nfs_attr_use_mounted_on_file() returns wrong value
[?]
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]
newpynfs fault-inject patch
patch (text/plain), 4.30 KB, created by
Jian Li
on 2012-09-07 18:03:56 UTC
(
hide
)
Description:
newpynfs fault-inject patch
Filename:
MIME Type:
Creator:
Jian Li
Created:
2012-09-07 18:03:56 UTC
Size:
4.30 KB
patch
obsolete
>diff --git a/nfs4.0/lib/nfs4/nfs4state.py b/nfs4.0/lib/nfs4/nfs4state.py >index b6de12f..702ac2b 100755 >--- a/nfs4.0/lib/nfs4/nfs4state.py >+++ b/nfs4.0/lib/nfs4/nfs4state.py >@@ -984,6 +984,7 @@ class VirtualHandle(NFSFileHandle): > global inodecount > inodecount += 1 > self.fattr4_fileid = inodecount >+ self.fattr4_mounted_on_fileid = inodecount > self.fattr4_maxfilesize = 2**32 # Are these enforced? > self.fattr4_maxname = 128 # Are these enforced? > self.fattr4_maxread = 1000 # Are these enforced? >@@ -1105,7 +1106,7 @@ class VirtualHandle(NFSFileHandle): > FATTR4_TIME_METADATA : "r", > FATTR4_TIME_MODIFY : "r", > FATTR4_TIME_MODIFY_SET : "w", >- FATTR4_MOUNTED_ON_FILEID : "rn", >+ FATTR4_MOUNTED_ON_FILEID : "r", > } > > def set_attributes(self, attrdict): >@@ -1365,6 +1366,8 @@ class HardHandle(NFSFileHandle): > ret_dict[attr] = 1700 > elif attr == FATTR4_FILEID: > ret_dict[attr] = stat_struct.st_ino >+ elif attr == FATTR4_MOUNTED_ON_FILEID : >+ ret_dict[attr] = stat_struct.st_ino > elif attr == FATTR4_MAXFILESIZE: > ret_dict[attr] = 1000000 > elif attr == FATTR4_MAXREAD: >diff --git a/nfs4.0/nfs4server.py b/nfs4.0/nfs4server.py >index 1943b2f..621300d 100755 >--- a/nfs4.0/nfs4server.py >+++ b/nfs4.0/nfs4server.py >@@ -292,6 +292,12 @@ class NFS4Server(rpc.RPCServer): > attrvals = self.curr_fh.get_attributes(attrs) > except NFS4Error, e: > return simple_error(e.code) >+ #sword >+ if not self.curr_fh is self.rootfh and op.opgetattr.attr_request & (1<<FATTR4_FILEID) : >+ #del fattr4_fileid >+ del attrvals[FATTR4_FILEID] >+ attrvals[FATTR4_MOUNTED_ON_FILEID] = self.curr_fh.fattr4_mounted_on_fileid >+ print " GETATTR result :", [ "%s:%s" % (nfs4lib.get_attr_name(i),attrvals[i]) for i in attrvals ] > garesok = GETATTR4resok(attrvals) > return simple_error(NFS4_OK, garesok) > >@@ -606,8 +612,8 @@ class NFS4Server(rpc.RPCServer): > return simple_error(NFS4_OK) > > def op_putrootfh(self, op): >- print " NEW FILEHANDLE %s" % repr(self.curr_fh) > self.curr_fh = self.rootfh >+ print " NEW FILEHANDLE %s" % repr(self.curr_fh) > return simple_error(NFS4_OK) > > def op_read(self, op): >@@ -672,6 +678,10 @@ class NFS4Server(rpc.RPCServer): > except NFS4Error: > if FATTR4_RDATTR_ERROR not in attrs: raise > attrvals = entry.fh.get_attributes([FATTR4_RDATTR_ERROR]) >+ #sword fhcache >+ self.fhcache[entry.fh.handle] = entry.fh >+ #sword delete fileid >+ del attrvals[FATTR4_FILEID] > entry.attr = attrvals > # Compute size of XDR encoding > e4 = entry4(entry.cookie, entry.name, entry.attr, []) >@@ -693,6 +703,8 @@ class NFS4Server(rpc.RPCServer): > d4 = dirlist4(e4, eof=0) > else: > d4 = dirlist4(e4, eof=1) >+ >+ print " READDIR RESULT: ", d4 > except NFS4Error, e: > return simple_error(e.code) > rdresok = READDIR4resok(cookieverf=verifier, reply=d4) >@@ -949,6 +961,25 @@ class NFS4Server(rpc.RPCServer): > > def startup(host, port): > rootfh = nfs4state.VirtualHandle() >+ rootfh.fattr_fileid=100 >+ >+ rootfh.create('test1', createtype4(NF4REG)); >+ fh = rootfh.lookup('test1') >+ if fh : >+ fh.handle = 'yTZOvirt43e292136dd18e54a6d0d8f9777db83a7eb3d740\x00\x00\x00\x00'; >+ fh.fattr4_filehandle = fh.handle >+ fh.fattr4_fsid = fsid4(0x0, 0x2) >+ else : >+ exit() >+ rootfh.create('test2', createtype4(NF4REG)); >+ fh = rootfh.lookup('test2') >+ if fh : >+ fh.handle = 'yTZOvirt43e292136dd18e54a6d0d8f9777db83a7eb3d740\x00\x00\x00\x00'; >+ fh.fattr4_filehandle = fh.handle >+ fh.fattr4_fsid = fsid4(0x0, 0x2) >+ else : >+ exit() >+ > server = NFS4Server(rootfh, port=port, host=host, pubfh=rootfh) > try: > import rpc.portmap as portmap >@@ -967,6 +998,8 @@ def startup(host, port): > pass > > if __name__ == "__main__": >+ import pdb >+ #pdb.set_trace() > port = 2049 > server = '' > if len(sys.argv) > 2:
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 842312
: 610824