[exFAT] Missing O_DIRECT Support Causes Errors in Python and Affects Applications

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



    Hello,

    I’ve encountered an issue with the exFAT driver when attempting to create an empty file, resulting in the following error:

    OSError: [Errno 14] Bad address

    Reproduction Steps:

    mkdir /tmp/exfat
    cd /tmp/exfat
    fallocate -l 512M exfat.img
    mkfs.exfat exfat.img
    sudo mkdir -p /fatimagedir/
    sudo mount -o umask=0022,gid=$(id -g),uid=$(id -u) /tmp/exfat/exfat.img /fatimagedir/
    cd /fatimagedir
    python3 -c 'open("foo", "wb", buffering=0).write(b"")'

    Observations:

        With the kernel exFAT driver:
            Produces OSError: [Errno 14] Bad address on Linux 6.12.10.
            Despite the error, the file is created.
            As noted by Artem S. Tashkinov:

                "While this code produces an error under Linux 6.12.10, it still works as intended - the file is created."

        With exFAT-FUSE:
            Works as expected without errors:

        sudo losetup -f exfat.img
        sudo fuse/mount.exfat-fuse -o loop,umask=0022,gid=$(id -g),uid=$(id -u) /dev/loop0 /fatimagedir/
        cd /fatimagedir
        python3 -c 'open("foo", "wb", buffering=0).write(b"")'
        ls
        foo

    Impact:

        Affects Python's file handling and popular applications like VSCodium and Zed, which rely on unbuffered I/O.
        Likely related to the lack of O_DIRECT support in the kernel exFAT driver.

    References:

        https://bugzilla.kernel.org/show_bug.cgi?id=219746
        https://bbs.archlinux.org/viewtopic.php?id=294837
        https://github.com/zed-industries/zed/issues/21595

    Is the lack of O_DIRECT support intentional, or would this be considered for future implementation?


    Best regards,
    Max Grass






[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux