WSL: linkat fails with EACCES when the target inode has deleted original hardlink

Please fill out the below information:

  • Your Windows build number: Microsoft Windows [Version 10.0.18362.53]

  • What you’re doing and what’s happening: (Copy&paste the full set of specific command-line steps necessary to reproduce the behavior, and their output. Include screen shots if that helps demonstrate the problem.)

$ touch foo
$ ln foo bar
$ rm -f foo
$ ln bar ham
ln: failed to create hard link 'ham' => 'bar': Permission denied
  • What’s wrong / what should be happening instead: The ln command shouldn’t fail. A hardlink named ham pointing to the same inode should be created.

  • Strace of the failing command, if applicable: (If some_command is failing, then run strace -o some_command.strace -f some_command some_args, and link the contents of some_command.strace in a gist here).

https://gist.github.com/trchen1033/9f004be23919f8f7a2ffff4b1da9bf7b

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 1
  • Comments: 24

Commits related to this issue

Most upvoted comments

I can reproduce this with build 18875’s wslfs, not happen lxfs. (wslfs is currently default filesystem for VolFs for new distribution install.)

Right, Craig’s fixinbound was Feb 12th which means there is no way this made 2004.

Under which circumstances resp since when is wslfs used as default file system? If it’s the default for everyone now we have a serious problem in openSUSE as the package manager would not work anymore with the images we have in the store.

I confirm. Tried on my other computer computer with the same distro except with lxfs. Very likely it’s a wslfs bug.