Problem running vhd through cifs

yavimaya
Posts: 8
Joined: Sun May 24, 2020 8:37 pm
Been thanked: 1 time

Problem running vhd through cifs

Unread post by yavimaya »

Hello,

Last time I used AO486 core was 6 months ago and it worked fine although I played other mister cores several times, almost at least once a week.
I've been running it always though cifs to a shared folder on a synology nas.

Today I was going to play ao486 also through cifs, asl always, but it refused to run.
I've tested it disconnecting cifs and playing by sd card and it worked fine, but not on cifs.
I've deleted shared games/ao486 folder and copied it from sdcard but result is the same.

I've connected usb debug cable to de10nano and I get always this error:

Code: Select all

Switch to core frame buffer
BIOS: games/AO486/boot0.rom
[  185.494325] CIFS: VFS: Couldn't get user pages (rc=-14)
BIOS: games/AO486/boot1.rom
[  185.502691] CIFS: VFS: Couldn't get user pages (rc=-14)

This is also the debug output when cifs foders are mounted at start of Mister Fpga

Code: Select all

Welcome to MiSTer (www.MiSTerFPGA.org)
login: *** reset bt ***
//192.168.1.36/MiSTer mounted
mount: /tmp/cifs_mount: //192.168.1.36/MiSTer already mounted on /tmp/cifs_mount.
//192.168.1.36/MiSTer not mounted
Done!
BIOS mounted
Filters mounted
Gamma mounted
Presets mounted
Shadow_Masks mounted
_Arcade mounted
_Computer mounted
_Console mounted
_Other mounted
_Utility mounted
cache mounted
cheats mounted
docs mounted
filters_audio mounted
font mounted
fonts mounted
games mounted
music mounted
saves mounted
savestates mounted
screenshots mounted
tmp mounted
wallpapers mounted
Done!

And this is the content of cifs_mount.ini

Code: Select all

SERVER="deleted"
SHARE="deleted"
USERNAME="deleted"
PASSWORD="deleted"
LOCAL_DIR="*"
WAIT_FOR_SERVER="true"
MOUNT_AT_BOOT="true"
ADDITIONAL_MOUNT_OPTIONS="vers=3.0"
SINGLE_CIFS_CONNECTION="true"
#Pipe "|" separated list of directories which will never be mounted when LOCAL_DIR="*"
SPECIAL_DIRECTORIES="linux|Scripts|System Volume Information"

I can still play other cores including chd based ones from cifs mount and they run like a charm, the problem is only with vhd imagen on a0486 core.

I have to mention that I've upgraded synology dsm from 6.X to 7.1.1 a month ago if it helps.

Best regards.

pac
Posts: 83
Joined: Mon May 25, 2020 6:11 am
Has thanked: 76 times
Been thanked: 28 times

Re: Problem running vhd through cifs

Unread post by pac »

Iirc you need to have the rights to write, read only won't work for VHDs, so you might want to check that first.

yavimaya
Posts: 8
Joined: Sun May 24, 2020 8:37 pm
Been thanked: 1 time

Re: Problem running vhd through cifs

Unread post by yavimaya »

pac wrote: Tue Jun 06, 2023 9:52 am

Iirc you need to have the rights to write, read only won't work for VHDs, so you might want to check that first.

I've checked x times that user in cifs_mount.ini has rw rights on shared folders on Synology. Any tips where else to look at?

Thanks!

yavimaya
Posts: 8
Joined: Sun May 24, 2020 8:37 pm
Been thanked: 1 time

Re: Problem running vhd through cifs

Unread post by yavimaya »

Solved throwing away SMB / CIFS on synology DSM 7.x and using NFS

pac
Posts: 83
Joined: Mon May 25, 2020 6:11 am
Has thanked: 76 times
Been thanked: 28 times

Re: Problem running vhd through cifs

Unread post by pac »

No other hints beside it's working fine on my end, similar setup (Synology with DSM 7). SMB v3 is configured on the NAS?

yavimaya
Posts: 8
Joined: Sun May 24, 2020 8:37 pm
Been thanked: 1 time

Re: Problem running vhd through cifs

Unread post by yavimaya »

pac wrote: Tue Jun 06, 2023 8:36 pm

No other hints beside it's working fine on my end, similar setup (Synology with DSM 7). SMB v3 is configured on the NAS?

I've tried with SMB2 minimum and SMB3.
I think I've tried all possible configurations... maybe the key one was missed

pac
Posts: 83
Joined: Mon May 25, 2020 6:11 am
Has thanked: 76 times
Been thanked: 28 times

Re: Problem running vhd through cifs

Unread post by pac »

See attachment for "my" configuration (pretty much standard iirc).

Attachments
Screenshot 2023-06-07 at 07.43.15.png
Screenshot 2023-06-07 at 07.43.15.png (137.73 KiB) Viewed 5591 times
madmalkav
Posts: 25
Joined: Fri Sep 20, 2024 11:45 am
Has thanked: 4 times
Been thanked: 3 times

Re: Problem running vhd through cifs

Unread post by madmalkav »

I'm having the exact same problem. I use TrueNAS Scale as a NAS, but nothing weird on the log there either. I'm using NFS now as an alternative (you need to enable NFSv4 on your NAS for this), but I would love to figure out what is happening with CIFS.

Bas
Top Contributor
Posts: 653
Joined: Fri Jan 22, 2021 4:36 pm
Has thanked: 86 times
Been thanked: 339 times

Re: Problem running vhd through cifs

Unread post by Bas »

In the constellation around CIFS you're dealing with two sets of permissions:

  • File system permissions on the server side. Files/directories must be writable for the Linux user that Samba uses on the NAS.
  • CIFS permissions. Files/directories must be writable for the Samba user that the CIFS protocol uses on the NAS.

These are two distinct sets of users that are generally in sync between Samba and the OS, but issues may be present there.

If you're using Windows a the CIFS server, you'll have similar permissions sets but only one set of users/groups so that's slightly less complicated.

madmalkav
Posts: 25
Joined: Fri Sep 20, 2024 11:45 am
Has thanked: 4 times
Been thanked: 3 times

Re: Problem running vhd through cifs

Unread post by madmalkav »

It has nothing to do with permissions, I have every single permission needed. I can access and copy and delete and everthing, it is only when I try to load a game with AO486 core that I get

Code: Select all

CIFS: VFS: Couldn't get user pages (rc=-14)

EDIT: same problem with Neogeo.

Bas
Top Contributor
Posts: 653
Joined: Fri Jan 22, 2021 4:36 pm
Has thanked: 86 times
Been thanked: 339 times

Re: Problem running vhd through cifs

Unread post by Bas »

How big is the VHD you're trying to access?

(I'm setting up a lab setup to debug this one.. seeing if I can reproduce this somehow)

madmalkav
Posts: 25
Joined: Fri Sep 20, 2024 11:45 am
Has thanked: 4 times
Been thanked: 3 times

Re: Problem running vhd through cifs

Unread post by madmalkav »

Size doesn't seen to matter, I have tried games that doesn't reach 1MB and the problem is the same. Also, as I said this happens too with the NeoGeo core, couldn't get a single game to load no matter the size.

I've opened a ticket on the MiSTer kernel repository because I think this may be a problem of the CIFS code in the kernel.

madmalkav
Posts: 25
Joined: Fri Sep 20, 2024 11:45 am
Has thanked: 4 times
Been thanked: 3 times

Re: Problem running vhd through cifs

Unread post by madmalkav »

Got a 6.10 kernel to test on Discord but same problem:

Code: Select all

[  100.011455] netfs: Couldn't get user pages (rc=-14)
[  100.016367] netfs: Zero-sized read [R=1]

Given a way more recent kernel still have the problem, and the problem only happens with AO486 and NeoGeo, probably the problem is not in the kernel.

PS: found at least one report of this happening to NeoGeo on github: https://github.com/MiSTer-devel/NeoGeo_ ... issues/133

FPGA64
Top Contributor
Posts: 1033
Joined: Mon Mar 01, 2021 3:10 pm
Has thanked: 51 times
Been thanked: 401 times

Re: Problem running vhd through cifs

Unread post by FPGA64 »

The cores dont talk to the Storage directly they all go through the Main Mister. So it cant be the core

madmalkav
Posts: 25
Joined: Fri Sep 20, 2024 11:45 am
Has thanked: 4 times
Been thanked: 3 times

Re: Problem running vhd through cifs

Unread post by madmalkav »

EDIT: I'm dumb :lol:

madmalkav
Posts: 25
Joined: Fri Sep 20, 2024 11:45 am
Has thanked: 4 times
Been thanked: 3 times

Re: Problem running vhd through cifs

Unread post by madmalkav »

I can confirm the problem is triggered when kernel oplocks are enabled on the cifs share. As why this happens only to certain cores, I have no clue. It would be nice to find and fix it on the MiSTer side, because those oplocks are a good thing to have at least on certain scenarios. But no clue yet at where the problem is.

Bas
Top Contributor
Posts: 653
Joined: Fri Jan 22, 2021 4:36 pm
Has thanked: 86 times
Been thanked: 339 times

Re: Problem running vhd through cifs

Unread post by Bas »

Dropping this here, might be useful for this.

https://wiki.samba.org/index.php/LinuxCIFSKernel

madmalkav
Posts: 25
Joined: Fri Sep 20, 2024 11:45 am
Has thanked: 4 times
Been thanked: 3 times

Re: Problem running vhd through cifs

Unread post by madmalkav »

I have confirmed that there is a least one Samba bug involved in this, maybe two. I will be updating what I find in https://github.com/MiSTer-devel/Linux-K ... /issues/58

Post Reply