Skip to content

getdents() returns EPERM on drvfs mounted WebDAV filesystem #2163

Closed

Description

@therealkenc
  • Your Windows build number: (Type ver at a Windows Command Prompt)

Microsoft Windows [Version 10.0.16199.1000]

  • What you're doing and what's happening:

On windows:

C:\> NET USE X: https://www.webdavserver.com:443/Userf426f6f/
C:\> X:
X:\> DIR
 Volume in drive X has no label.
 Volume Serial Number is 0000-0000

 Directory of X:\

2017-02-01  02:42 AM    <DIR>          .
2017-02-01  02:42 AM    <DIR>          ..
2017-02-08  03:56 PM           301,633 Document.pages
2017-02-08  03:56 PM                 0 General.docx
2017-02-08  03:56 PM            27,140 Introduction.pptx
2016-09-30  01:38 AM    <DIR>          Library
2016-09-30  01:38 AM    <DIR>          My Directory
2017-02-08  03:56 PM                18 Notes.txt
[.... more contents of public directory]

That URL will be live for 72 hours, but you can create your own with one click at: https://www.webdavserver.com/.

On WSL:

$ sudo mkdir /mnt/x
$ sudo chmod 777 /mnt/x
$ sudo mount -t drvfs X: /mnt/x   # drvfs mount is successful
$ ls /mnt/x
ls: reading directory '/mnt/x': Operation not permitted
  • Strace of the failing command, if applicable:

Relevant part of strace -ff ls /mnt/x

...
open("/mnt/x", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFDIR|0777, st_size=512, ...}) = 0
getdents(3, 0x898d10, 32768)            = -1 EPERM (Operation not permitted)
...

This is similar to #1954, but with EPERM instead of EINVAL. DrvFS does seem to know the files are there. If you cat /mnt/x/Notes.txt you get EINVAL (sic), but if you cat /mnt/x/Foobar.txt you get ENOENT (which is correct).

Activity

  1. sunilmut commented on Jun 6, 2017

    @sunilmut
    Member
  2. therealkenc commented on Jun 22, 2017

    @therealkenc
    Author

    Interesting progress of sorts with whatever #1952 related fixes went into 16226. Operation not permitted was squashed. Now with the identical repro steps as the OP:

    ken@HEADCRASH:~$ sudo mount -t drvfs X: /mnt/x
    ken@HEADCRASH:~$ ls /mnt/x
    ls: cannot access '/mnt/x/Document.pages': Invalid argument
    ls: cannot access '/mnt/x/General.docx': Invalid argument
    ls: cannot access '/mnt/x/Introduction.pptx': Invalid argument
    ls: cannot access '/mnt/x/Library\': No such file or directory
    ls: cannot access '/mnt/x/My Directory\': No such file or directory
    ls: cannot access '/mnt/x/Notes.txt': Invalid argument
    [...]
    Document.pages     Library\       Presentation.key  Sales\               Templates\
    General.docx       My Directory\  Products\         Spreadsheet.numbers
    Introduction.pptx  Notes.txt      Project.pdf       Stat.xlsx
    
  3. SvenGroot commented on Jun 22, 2017

    @SvenGroot
    Member

    WebDAV is for some reason failing our attempt to open files with STATUS_INVALID_PARAMETER. Since WebDAV is not one of the explicitly supported file systems by DrvFs at this point, I don't think this'll be addressed for the Fall Creator's Update.

  4. added
    wsl2
    on Jun 19, 2019
  5. microsoft-github-policy-service commented on Feb 1, 2024

    @microsoft-github-policy-service
    Contributor

    This issue has been automatically closed since it has not had any activity for the past year. If you're still experiencing this issue please re-file this as a new issue or feature request.

    Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    file systemwsl2

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions