[Bugs] [Bug 1793990] lseek SEEK_DATA - File descriptor in bad state

bugzilla at redhat.com bugzilla at redhat.com
Wed Jan 22 13:09:39 UTC 2020


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



--- Comment #1 from Tomáš Mózes <hydrapolic at gmail.com> ---
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.

-- 
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