[Bugs] [Bug 1311146] New: glfs_dup() functionality is broken
bugzilla at redhat.com
bugzilla at redhat.com
Tue Feb 23 13:47:06 UTC 2016
https://bugzilla.redhat.com/show_bug.cgi?id=1311146
Bug ID: 1311146
Summary: glfs_dup() functionality is broken
Product: GlusterFS
Version: mainline
Component: libgfapi
Severity: medium
Assignee: bugs at gluster.org
Reporter: ppai at redhat.com
QA Contact: sdharane at redhat.com
CC: bugs at gluster.org
Description of problem:
***********************
glfs_dup() functionality is currently broken in glusterfs.
Steps to Reproduce:
*******************
Code snippet from libgfapi-python tests:
f = File(self.vol.open("dune", os.O_CREAT | os.O_EXCL | os.O_RDWR))
f.write("I must not fear. Fear is the mind-killer.")
fdup = f.dup()
self.assertTrue(isinstance(fdup, File))
f.close()
ret = fdup.lseek(0, os.SEEK_SET)
self.assertEqual(ret, 0)
Actual results:
***************
ERROR: test_write_file_dup_lseek_read
(test.functional.libgfapi-python-tests.FileOpsTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/root/src/libgfapi-python/test/functional/libgfapi-python-tests.py",
line 236, in test_write_file_dup_lseek_read
ret = fdup.lseek(0, os.SEEK_SET)
File "/root/src/libgfapi-python/gluster/gfapi.py", line 306, in lseek
raise OSError(err, os.strerror(err))
OSError: [Errno 9] Bad file descriptor
Expected results:
*****************
lseek() should succeed.
Additional information
**********************
This change (http://review.gluster.org/13340) disallows any operation on
duplicate once the original fd is closed.
Seems like a deep copy of original fd instance should be done.
--
You are receiving this mail because:
You are on the CC list for the bug.
You are the assignee for the bug.
More information about the Bugs
mailing list