[Bugs] [Bug 1317863] New: glfs_dup() functionality is broken

bugzilla at redhat.com bugzilla at redhat.com
Tue Mar 15 11:49:39 UTC 2016


https://bugzilla.redhat.com/show_bug.cgi?id=1317863

            Bug ID: 1317863
           Summary: glfs_dup() functionality is broken
           Product: GlusterFS
           Version: 3.7.9
         Component: libgfapi
          Keywords: Triaged
          Severity: medium
          Priority: low
          Assignee: bugs at gluster.org
          Reporter: rjoseph at redhat.com
        QA Contact: sdharane at redhat.com
                CC: bugs at gluster.org, ndevos at redhat.com, ppai at redhat.com,
                    rjoseph at redhat.com, sdharane at redhat.com,
                    srangana at redhat.com
        Depends On: 1311146
            Blocks: 1303995



+++ This bug was initially created as a clone of Bug #1311146 +++

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.

--- Additional comment from Vijay Bellur on 2016-03-10 05:14:36 EST ---

REVIEW: http://review.gluster.org/13666 (gfapi: preserve glfd state during
glfs_dup) posted (#1) for review on master by Rajesh Joseph
(rjoseph at redhat.com)

--- Additional comment from  on 2016-03-10 05:59:58 EST ---

glfs_dup is completely broken. Current behavior is not in accordance with POSIX
dup (http://linux.die.net/man/2/dup)

http://review.gluster.org/13666 only addresses are very small subset of the
problem. glfs_dup needs to be re-written to fix the broken behavior. Therefore
not changing the state of the bug as of now.

--- Additional comment from Vijay Bellur on 2016-03-15 02:46:39 EDT ---

COMMIT: http://review.gluster.org/13666 committed in master by Niels de Vos
(ndevos at redhat.com) 
------
commit 5bdfaf98904a339144bf3a237b162e8385b95085
Author: Rajesh Joseph <rjoseph at redhat.com>
Date:   Wed Mar 9 22:05:18 2016 +0530

    gfapi: preserve glfd state during glfs_dup

    Following patch introduced a new state variable in glfd
    to track the current status of the fd.
    http://review.gluster.org/13340/

    But this state was not copied in glfd_dup function.

    BUG: 1311146
    Change-Id: I283f8944035f6defe491f81e13d7ef28fc440572
    Signed-off-by: Rajesh Joseph <rjoseph at redhat.com>
    Reviewed-on: http://review.gluster.org/13666
    Smoke: Gluster Build System <jenkins at build.gluster.com>
    Reviewed-by: Prashanth Pai <ppai at redhat.com>
    Tested-by: Prashanth Pai <ppai at redhat.com>
    NetBSD-regression: NetBSD Build System <jenkins at build.gluster.org>
    CentOS-regression: Gluster Build System <jenkins at build.gluster.com>
    Reviewed-by: Raghavendra Talur <rtalur at redhat.com>
    Reviewed-by: Niels de Vos <ndevos at redhat.com>


Referenced Bugs:

https://bugzilla.redhat.com/show_bug.cgi?id=1303995
[Bug 1303995] SMB: SMB crashes with AIO enabled on reads + vers=3.0
https://bugzilla.redhat.com/show_bug.cgi?id=1311146
[Bug 1311146] glfs_dup() functionality is broken
-- 
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