WSL icon indicating copy to clipboard operation
WSL copied to clipboard

'Operation not permitted' when accessing network shares mounted with drvfs from an IBM iSeries host

Open mphaney opened this issue 9 years ago • 16 comments

Currently using Insider build 16176.

When attempting to access a network share from an IBM iSeries running OS version V5R1 (if that matters), any command returns the error "Operation not permitted". Like so:

$ sudo mkdir /mnt/ibm
$ sudo mount -t drvfs '\\ibmserver\ifs' /mnt/ibm
$ ls /mnt/ibm
ls: reading directory '/mnt/ibm': Operation not permitted
$ sudo ls /mnt/ibm
ls: reading directory '/mnt/ibm': Operation not permitted

Also tried mapping the share to a Windows drive letter first, but the same result was encountered:

$ sudo mount -t drvfs Z: /mnt/ibm
$ ls /mnt/ibm
ls: reading directory '/mnt/ibm': Operation not permitted
$ sudo ls /mnt/ibm
ls: reading directory '/mnt/ibm': Operation not permitted

I have verified in Windows Credential Manager that all of the credentials are correct and, indeed, simply accessing the files via Windows Explorer like "normal" works just fine. It is also worth noting that accessing removable storage (USB thumb drive) and folders shared from other Windows machines appears to work fantastically.

mphaney avatar Apr 19 '17 16:04 mphaney

Not sure if it's relevant, but thought I'd also include that our IBM server is a "System p" and not an "AIX" server.

mphaney avatar Apr 19 '17 16:04 mphaney

Can you share what network file protocol the server is providing?

dethoma avatar Apr 19 '17 18:04 dethoma

Hi @mphaney

Could you run enable tracing as per the instructions here under point 8, and send me the log files? Hopefully it'll provide a clue as to what's going wrong.

SvenGroot avatar Apr 19 '17 19:04 SvenGroot

@dethoma When I spoke with our system manager, he believed it is providing both NFS and Samba. Unfortunately I don't know enough to be able to judge the usefulness or accuracy of that statement.

@SvenGroot Attached are the 4 log files generated. Thank you! (Nuts, I believe I attached incorrect logs the first time, I've edited this comment and attached what I hope are the correct logs now). drvfs_mount_logs.zip

mphaney avatar Apr 20 '17 16:04 mphaney

Rats. Appears to still be an issue in build 16188. Anything else I can try to provide? @SvenGroot @dethoma?

mphaney avatar May 04 '17 20:05 mphaney

The logs are empty for me, can you start the logs before you do the first bash launch and then stop it after you close the bash instance?

dethoma avatar May 04 '17 21:05 dethoma

Dang it. Ok, with a freshly rebooted system, I opened up an elevated command prompt, ran exactly these commands (all from within the same window):

> logman.exe create trace lxcore_kernel -p {0CD1C309-0878-4515-83DB-749843B3F5C9} -mode 0x00000008 -ft 10:00 -o .\lxcore_kernel.etl -ets
> logman create trace lxcore_adss -p {754E4536-6735-4194-BE81-1374BD2E9B0D} -ft 1:00 -rt -o .\lxcore_adss.etl -ets
> logman create trace lxcore_user -p {D90B9468-67F0-5B3B-42CC-82AC81FFD960} -ft 1:00 -rt -o .\lxcore_user.etl -ets
> logman create trace lxcore_service -p {B99CDB5A-039C-5046-E672-1A0DE0A40211} -ft 1:00 -rt -o .\lxcore_service.etl -ets

> bash
$ sudo mount -t drvfs '\\qspokane\usr\local\zendsvr6\var\log' /mnt/logs
$ ls /mnt/logs
$ sudo ls /mnt/logs
$ sudo umount /mnt/logs
$ exit

> logman stop lxcore_kernel -ets
> logman stop lxcore_adss -ets
> logman stop lxcore_user -ets
> logman stop lxcore_service -ets

Then I rebooted again and did the same thing except with a non-elevated command prompt. Zipped all of the files up here. Sure hoping I got it right this time :-P drvfs_mount_logs.zip

mphaney avatar May 10 '17 17:05 mphaney

Just another quick update to note the problem still exists in build 16193 (so much for hoping for dumb luck :-) ). @dethoma How'd I do on the logs this go-around?

mphaney avatar May 12 '17 14:05 mphaney

Thanks for sharing the logs, we are failing on the getdents system call(used with ls) with the file share and also failing on querying volume information on it. Since we only support SMB today it is highly likely there is some aspect of the server that is not compatible with our SMB expectations if it is indeed an SMB server.

From regular Windows cmd prompt how are you accessing this share today? That will reveal more clues.

dethoma avatar May 12 '17 17:05 dethoma

From the regular cmd prompt, the follow commands have always worked successfully for me:

> net use y: \\qspokane\usr\local\zendsvr6\var\log
> y:
> dir

I'll see if I can figure out whether it's truly using SMB or not. The tools IBM gives us to configure these things aren't terribly verbose, so I'm kind of flailing blind.

mphaney avatar May 12 '17 17:05 mphaney

You could start a packet trace when you run that command and see what happens after the mount command using Wireshark. Just a thought.

MrObvious avatar May 16 '17 01:05 MrObvious

Ok, this is my first shot at a Wireshark trace. Hopefully I've exported relevant data. This trace represents the initial mount after a fresh boot (which gave no errors on the screen), an attempt to list the contents of the mounted folder, and a subsequent umount: https://pastebin.com/vecKavEJ Thank you. Let me know if I can provide anything else.

mphaney avatar Jun 09 '17 15:06 mphaney

Everything is SMB1, so yeah. Would it work better if you used the net use from Windows first? You could add that to your bash shell.

MrObvious avatar Jun 09 '17 15:06 MrObvious

We believe we understand this issue. The problem is that the server does not support the file enumeration class we're using to list the directory. We've recently fixed this internally by allowing DrvFs to fall back to a different enumeration class if the preferred one isn't supported. This fix should be available in a future insider build.

SvenGroot avatar Jun 09 '17 17:06 SvenGroot

Excellent, thank you! I look forward to seeing that :-)

mphaney avatar Jun 12 '17 19:06 mphaney

YES! This is now working as of build 16226. Thank you all for your hard work!

mphaney avatar Jun 22 '17 18:06 mphaney