Zero available disk space with Wine prefix on ZFS.

Open forum for end-user questions about Wine. Before asking questions, check out the Wiki as a first step.
Forum Rules
Locked
werman
Level 1
Level 1
Posts: 5
Joined: Sat Mar 03, 2018 10:08 am

Zero available disk space with Wine prefix on ZFS.

Post by werman »

Hello,

I have installed Wine prefix on zfs pool which has lot of free space however applications while running in wine report zero available space. For example explorer shows zero used space and zero available space for disc 'C'. This prevents any app which checks for disk space from installing, e.g. I cannot install any game with gog launcher. Any application which doesn't check space runs fine.

If prefix is installed on other partition everything runs fine.

I'm running Arch Linux with kernel 4.15.5-1.
Zfs kernel module: linux415-zfs 0.7.5-6, Zfs pool mount options: rw,xattr,noacl
I have tried Wine versions 3.2-1 and Wine staging 3.3.r3576.1fdaf4c4

There is one error in logs while running apps with prefix on ZFS:
005d:fixme:ntdll:FILE_GetNtStatus Converting errno 75 to STATUS_UNSUCCESSFUL
It is repeated several times and it seems that something goes wrong when retrieving information about disk.

I didn't find anyone who has similar issue so maybe there is something wrong with my configuration but I cannot spot any, e.g. Dolphine file manager sees all available space.

Thanks.
User avatar
Bob Wya
Level 12
Level 12
Posts: 3068
Joined: Sat Oct 16, 2010 7:40 pm

Re: Zero available disk space with Wine prefix on ZFS.

Post by Bob Wya »

@werman

Ah interesting problem! I can't really replicate that easily - as I only ZFS on my NAS (also running Arch ironically) - which is of course headless.

It would probably be best to get a full debugging log for the simplest application you can find - that reports a disc space error.

Since wineserver does the actual storage access - acting on messages from Wine processes (passed via socket) - it's best to get a log from this process:

Code: Select all

wineserver -f -d &>~/wineserver_zfs_terminal_log.txt
Then set the WINEDEBUG environment variable to capture all debug channels, process information and timestamps...

Code: Select all

export WINEDEBUG=+timestamp,+tid,+all
wine ... &>~/wine_zfs_terminal_log.txt
Then post the 2 debug logs - probably on a pastebin-type site - as the log(s) may be long (very long)...

I presume your Linux/Wine user has rw+exec access to the ZFS subvolume that you storing your WINEPREFIX on.
I would expect setting up a WINEPREFIX would fail totally - if you didn't...
Even simple tools like df will work on ZFS subvolumes - though they may over report freespace, due to hidden COW storage.
But I presume the issue has to be that WINE is not interrogating the ZFS VFS correctly for freespace...

That error, that you quoted, is extremely unenlightening... As it's the fall-through default for a function that simply enumerates storage/disk error codes!

Code: Select all

NTSTATUS FILE_GetNtStatus(void)
{
    int err = errno;

    TRACE( "errno = %d\n", errno );
    switch (err)
    {
   ...
    default:
        FIXME( "Converting errno %d to STATUS_UNSUCCESSFUL\n", err );
        return STATUS_UNSUCCESSFUL;
    }
}
Ta
Bob
werman
Level 1
Level 1
Posts: 5
Joined: Sat Mar 03, 2018 10:08 am

Re: Zero available disk space with Wine prefix on ZFS.

Post by werman »

@Bob Wya Thanks for suggestions!
Even for explorer full logs are insanly verbose (20+ mb). I'll uploaded them if needed but I think I'll first tell what I have found.
I have debugged the issue and I think I managed to pinpoint the culprit:

'file.c':3222 - NtQueryVolumeInformationFile:

Code: Select all

                
                struct statfs stfs;
                if (fstatfs( fd, &stfs ) < 0)
                {
                    io->u.Status = FILE_GetNtStatus();
                    break;
                }
                bsize = stfs.f_bsize;
After this call to fstatfs 'errno' is set to 75 which means 'Value too large for defined data type' this probably means it's an issue with 64 bit inodes https://www.tcm.phy.cam.ac.uk/sw/inodes64.html - seems to be expected behaviour with 32 bit binaries. My ZFS partition has a size of 3.6T which probably triggered the issue:

Code: Select all

Filesystem                    Size  Used Avail Use% Mounted on
datastorage                 3.6T  683G  2.9T  19% /mnt/data
Should I submit the issue on bugtracker?
User avatar
Bob Wya
Level 12
Level 12
Posts: 3068
Joined: Sat Oct 16, 2010 7:40 pm

Re: Zero available disk space with Wine prefix on ZFS.

Post by Bob Wya »

werman wrote: I have debugged the issue and I think I managed to pinpoint the culprit:

Code: Select all

dlls/ntdll/file.c:3222    - NtQueryVolumeInformationFile:

...
                struct statfs stfs;
                if (fstatfs( fd, &stfs ) < 0)
                {
                    io->u.Status = FILE_GetNtStatus();
                    break;
                }
                bsize = stfs.f_bsize;
...
After this call to fstatfs 'errno' is set to 75 which means 'Value too large for defined data type' this probably means it's an issue with 64 bit inodes https://www.tcm.phy.cam.ac.uk/sw/inodes64.html - seems to be expected behaviour with 32 bit binaries. My ZFS partition has a size of 3.6T which probably triggered the issue:

Code: Select all

Filesystem                    Size  Used Avail Use% Mounted on
datastorage                 3.6T  683G  2.9T  19% /mnt/data
Should I submit the issue on bugtracker?
Ah nice catch... I presume we should be using statfs64 on 64-bit systems... 8)

Yeah definitely put this on the WineHQ Bugzilla - I'm sure we'll all be running ZFS one these days. :lol:
I can't find any duplicate bugs...

Bob
werman
Level 1
Level 1
Posts: 5
Joined: Sat Mar 03, 2018 10:08 am

Re: Zero available disk space with Wine prefix on ZFS.

Post by werman »

I have created a bug https://bugs.winehq.org/show_bug.cgi?id=44679, but even statfs64 fails with EOVERFLOW which should not be the case. I've just compiled a test app and nothing makes statfs64 work. I'll just make a dirty patch to fix the issue for myself.
User avatar
Bob Wya
Level 12
Level 12
Posts: 3068
Joined: Sat Oct 16, 2010 7:40 pm

Re: Zero available disk space with Wine prefix on ZFS.

Post by Bob Wya »

werman wrote:I have created a bug https://bugs.winehq.org/show_bug.cgi?id=44679, but even statfs64 fails with EOVERFLOW which should not be the case. I've just compiled a test app and nothing makes statfs64 work. I'll just make a dirty patch to fix the issue for myself.
Hmmm, always the way...
Like patches i use to remove the warnings about Nvidia xrandr being broken and to disable the Virtual Desktop panel/systemtray with a registry key. :lol:

Does it help to set a quota on the ZFS Pool subvolume you're using? See: Github / Steam for Linux: Error: Steam "needs at least 250MB" free space when plenty of space #4982.
Probably along with patching with statfs64. Although Wine may be making the statfs calls in a 32-bit address space??

Also see: Github / Steam for Linux: [SteamCMD] XFS inode64 issues #4824.
Which probably isn't so relevant - but an interesting read...

I'll probably stick to good ol' ext4 for the time being (for my Desktops)... :lol:

Bob
werman
Level 1
Level 1
Posts: 5
Joined: Sat Mar 03, 2018 10:08 am

Re: Zero available disk space with Wine prefix on ZFS.

Post by werman »

Oh thanks for the links! I had the same issue with steam but just created symlink to a folder on ZFS partition and didn't get into the details. I'll try quota later.

It seams that statfs64 returning error when it shoudn't is possibly an issue in kernel:
Thread start: https://www.spinics.net/lists/linux-fsd ... 16442.html
Final unapproved patch: https://www.spinics.net/lists/linux-fsd ... 17132.html
werman
Level 1
Level 1
Posts: 5
Joined: Sat Mar 03, 2018 10:08 am

Re: Zero available disk space with Wine prefix on ZFS.

Post by werman »

I've created a ZFS mount point with quota for wine prefixes and it works!
Thank you.
User avatar
Bob Wya
Level 12
Level 12
Posts: 3068
Joined: Sat Oct 16, 2010 7:40 pm

Re: Zero available disk space with Wine prefix on ZFS.

Post by Bob Wya »

werman wrote:I've created a ZFS mount point with quota for wine prefixes and it works!
Thank you.
Ahhh, that's actually quite amazing... :)
Locked