Please ignore the last line. Git clone operation is failing with fanotify example code as well. root@MININT-S244RA7:/mnt/c/Users/kvitta/Desktop/MDE binaries/GitCloneIssue# ./fanotify_ex /mnt/c Press enter key to terminate. root@MININT-S244RA7:/mnt/c/Users/kvitta/Desktop/MDE binaries/GitCloneIssue# ./fanotify_ex /mnt/c Press enter key to terminate. Listening for events. FAN_OPEN_PERM: File /mnt/c/Users/kvitta/gtest/.git/info/exclude FAN_CLOSE_WRITE: File /mnt/c/Users/kvitta/gtest/.git/info/exclude FAN_OPEN_PERM: File /mnt/c/Users/kvitta/gtest/.git/hooks/pre-applypatch.sample FAN_CLOSE_WRITE: File /mnt/c/Users/kvitta/gtest/.git/hooks/pre-applypatch.sample FAN_OPEN_PERM: File /mnt/c/Users/kvitta/gtest/.git/hooks/applypatch-msg.sample FAN_CLOSE_WRITE: File /mnt/c/Users/kvitta/gtest/.git/hooks/applypatch-msg.sample FAN_OPEN_PERM: File /mnt/c/Users/kvitta/gtest/.git/hooks/commit-msg.sample FAN_CLOSE_WRITE: File /mnt/c/Users/kvitta/gtest/.git/hooks/commit-msg.sample FAN_OPEN_PERM: File /mnt/c/Users/kvitta/gtest/.git/hooks/pre-push.sample FAN_CLOSE_WRITE: File /mnt/c/Users/kvitta/gtest/.git/hooks/pre-push.sample FAN_OPEN_PERM: File /mnt/c/Users/kvitta/gtest/.git/hooks/pre-merge-commit.sample FAN_CLOSE_WRITE: File /mnt/c/Users/kvitta/gtest/.git/hooks/pre-merge-commit.sample FAN_OPEN_PERM: File /mnt/c/Users/kvitta/gtest/.git/hooks/pre-commit.sample FAN_CLOSE_WRITE: File /mnt/c/Users/kvitta/gtest/.git/hooks/pre-commit.sample FAN_OPEN_PERM: File /mnt/c/Users/kvitta/gtest/.git/hooks/post-update.sample FAN_CLOSE_WRITE: File /mnt/c/Users/kvitta/gtest/.git/hooks/post-update.sample FAN_OPEN_PERM: File /mnt/c/Users/kvitta/gtest/.git/hooks/push-to-checkout.sample FAN_CLOSE_WRITE: File /mnt/c/Users/kvitta/gtest/.git/hooks/push-to-checkout.sample FAN_OPEN_PERM: File /mnt/c/Users/kvitta/gtest/.git/hooks/fsmonitor-watchman.sample FAN_CLOSE_WRITE: File /mnt/c/Users/kvitta/gtest/.git/hooks/fsmonitor-watchman.sample FAN_OPEN_PERM: File /mnt/c/Users/kvitta/gtest/.git/hooks/update.sample FAN_CLOSE_WRITE: File /mnt/c/Users/kvitta/gtest/.git/hooks/update.sample FAN_OPEN_PERM: File /mnt/c/Users/kvitta/gtest/.git/hooks/pre-rebase.sample FAN_CLOSE_WRITE: File /mnt/c/Users/kvitta/gtest/.git/hooks/pre-rebase.sample FAN_OPEN_PERM: File /mnt/c/Users/kvitta/gtest/.git/hooks/pre-receive.sample FAN_CLOSE_WRITE: File /mnt/c/Users/kvitta/gtest/.git/hooks/pre-receive.sample FAN_OPEN_PERM: File /mnt/c/Users/kvitta/gtest/.git/hooks/prepare-commit-msg.sample FAN_CLOSE_WRITE: File /mnt/c/Users/kvitta/gtest/.git/hooks/prepare-commit-msg.sample FAN_OPEN_PERM: File /mnt/c/Users/kvitta/gtest/.git/description FAN_CLOSE_WRITE: File /mnt/c/Users/kvitta/gtest/.git/description FAN_OPEN_PERM: File /mnt/c/Users/kvitta/gtest/.git/HEAD.lock FAN_CLOSE_WRITE: File /mnt/c/Users/kvitta/gtest/.git/HEAD.lock FAN_OPEN_PERM: File /mnt/c/Users/kvitta/gtest/.git/config.lock FAN_CLOSE_WRITE: File /mnt/c/Users/kvitta/gtest/.git/config.lock FAN_OPEN_PERM: File /mnt/c/Users/kvitta/gtest/.git/config.lock FAN_OPEN_PERM: File /mnt/c/Users/kvitta/gtest/.git/config FAN_OPEN_PERM: File /mnt/c/Users/kvitta/gtest/.git/config FAN_CLOSE_WRITE: File /mnt/c/Users/kvitta/gtest/.git/config FAN_OPEN_PERM: File /mnt/c/Users/kvitta/gtest/.git/config.lock FAN_OPEN_PERM: File /mnt/c/Users/kvitta/gtest/.git/config FAN_OPEN_PERM: File /mnt/c/Users/kvitta/gtest/.git/config FAN_CLOSE_WRITE: File /mnt/c/Users/kvitta/gtest/.git/config FAN_OPEN_PERM: File /mnt/c/Users/kvitta/gtest/.git/config.lock FAN_OPEN_PERM: File /mnt/c/Users/kvitta/gtest/.git/config FAN_OPEN_PERM: File /mnt/c/Users/kvitta/gtest/.git/config FAN_CLOSE_WRITE: File /mnt/c/Users/kvitta/gtest/.git/config FAN_OPEN_PERM: File /mnt/c/Users/kvitta/gtest/.git/tNbqjiA read: No such file or directory root@MININT-S244RA7:/mnt/c/Users/kvitta/Desktop/MDE binaries/GitCloneIssue# Thank you, Krishna Vivek -----Original Message----- From: Krishna Vivek Vitta Sent: Tuesday, September 24, 2024 5:30 PM To: Amir Goldstein <amir73il@xxxxxxxxx> Cc: linux-fsdevel@xxxxxxxxxxxxxxx; jack@xxxxxxx Subject: RE: [EXTERNAL] Re: Git clone fails in p9 file system marked with FANOTIFY Yes, we are testing in WSL environment. On removing the mount mark, git clone succeeds. We are using the releases from: https://github.com/microsoft/WSL2-Linux-Kernel/releases Did u get to try git clone operation on 9p mount on your setup ? May I know the kernel version ? Can you share the commands of how you created a 9p mount on your test box ? Please find the code for rename(attached), execute and share the result in 9p mount of ur setup. I have tested the fanotify example. It is working in WSL environment. Infact even, in the example code, I have marked only with FAN_CLOSE_WRITE mask. This event handler is recognizing the event and printing it. Thank you, Krishna Vivek -----Original Message----- From: Amir Goldstein <amir73il@xxxxxxxxx> Sent: Tuesday, September 24, 2024 2:27 PM To: Krishna Vivek Vitta <kvitta@xxxxxxxxxxxxx> Cc: linux-fsdevel@xxxxxxxxxxxxxxx; jack@xxxxxxx Subject: Re: [EXTERNAL] Re: Git clone fails in p9 file system marked with FANOTIFY On Tue, Sep 24, 2024 at 7:25 AM Krishna Vivek Vitta <kvitta@xxxxxxxxxxxxx> wrote: > > Hi Amir > > Thanks for the reply. > > We have another image with kernel version: 6.6.36.3. git clone operation fails there as well. Do we need to still try with 5.15.154 kernel version ? No need. > > Currently, we are marking the mount points with mask(FAN_CLOSE_WRITE) to handle only close_write events. Do we need to add any other flag in mask and check ? No need. > > Following is the mount entry in /proc/mounts file: > C:\134 /mnt/c 9p > rw,noatime,aname=drvfs;path=C:\;uid=0;gid=0;symlinkroot=/mnt/,cache=5, > access=client,msize=65536,trans=fd,rfd=4,wfd=4 0 0 I don't know this symlinkroot feature. It looks like a WSL2 feature (?) and my guess is that the failure might be related. Not sure how fanotify mount mark affects this, maybe because the close_write events open the file for reporting the event, but maybe you should try to ask your question also the WSL2 kernel maintainers. I have tried to reproduce your test case on the 9p mount on my test box: v_tmp on /vtmp type 9p (rw,relatime,access=client,msize=262144,trans=virtio) with fanotify examples program: https://manpages.debian.org/unstable/manpages/fanotify.7.en.html#Example_program:_fanotify_example.c and could not reproduce the issue with plain: echo 123 > x && mv x y && cat y > > Attached is the strace for failed git clone operation(line: 419, 420). All the failures are ENOENT, which is why I suspect maybe related to the symlinkroot thing. > Even I wrote a small program to invoke rename, followed with open. > The open fails immediately and succeeds after 3-4 iterations. > This exercise was performed on p9 file system marked with fanotify. Please share your reproducer program. The difference could be in the details. Can you test in a 9p mount without those WSL options? Can you test on upstream or LTS kernel? Can you test with the fanotify example? > > Am not reporting this as regression. We havent checked this behavior before. > Ok. patience, we will try to get to the bottom of this. Thanks, Amir.