Description of problem: Version-Release number of selected component (if applicable): How reproducible: Steps to Reproduce: 1. 2. 3. Actual results: Expected results: Additional info:
In Gentoo Linux we use portage to install software. That software is usually built from source so it's a good candidate for a shared storage if used by hundreds of systems to avoid re-downloading on multiple systems. While installing some packages in Gentoo (having the source repository on Glusterfs) we discovered that lseek SEEK_DATA isn't working properly on Glusterfs. A working example on ext4: # dd if=/dev/zero of=/tmp/sparse bs=1M count=0 seek=1 # echo hi >> /tmp/sparse # python3 ./lseek-seek-data.py /tmp/sparse 1048576 A failure on glusterfs volume (/usr/portage/distfiles): # dd if=/dev/zero of=/usr/portage/distfiles/sparse bs=1M count=0 seek=1 # echo hi >> /usr/portage/distfiles/sparse # python3 ./lseek-seek-data.py /usr/portage/distfiles/sparse Traceback (most recent call last): File "./lseek-seek-data.py", line 19, in <module> main() File "./lseek-seek-data.py", line 15, in main print(os.lseek(input_file.fileno(), offset, os.SEEK_DATA)) OSError: [Errno 77] File descriptor in bad state lseek-seek-data.py: #!/usr/bin/env python3 import argparse import os def main(): parser = argparse.ArgumentParser() parser.add_argument('input_file') args = parser.parse_args() offset = 0 with open(args.input_file, 'rb', 0) as input_file: print(os.lseek(input_file.fileno(), offset, os.SEEK_DATA)) if __name__ == '__main__': main() Discussion in Gentoo: https://bugs.gentoo.org/705536 https://github.com/gentoo/portage/pull/498 The glusterfs volume is simple running default settings on version 6.7.
Looks like https://review.gluster.org/#/c/23530/ needs to be backported to the release-{6/7} branches. Assigning the bug to Pranith. @Tomas, for now, a workaround is to disable the open-behind translator: `gluster v set volname open-behind off`. Things will then work as expected.
Thanks @Ravishankar, the patch https://github.com/gluster/glusterfs/commit/9dd57ff963d4d0dde7f3ad0ff230837ff2f4b1df works fine with 6.7/7.2.
This bug is moved to https://github.com/gluster/glusterfs/issues/894, and will be tracked there from now on. Visit GitHub issues URL for further details