# fanotify bug:multi-thread opening file hangs when fanotify is on

- From: boyd yang \<hidden\>
- Date: 2011-09-27 09:21:11 
- List: linux-fsdevel
- Page: https://ratatoskr.run/linux-fsdevel/2011/09/57783
- Thread: https://ratatoskr.run/linux-fsdevel/2011/09/57783/t.md

```text
Hi All,

It seems that I find a bug of fanotify.

I use this fanotify sample to monitor open/access perms on the whole file
system(/): <http://git.infradead.org/users/eparis/fanotify-example.git>
http://git.infradead.org/users/eparis/fanotify-example.git
At the same time, I have a test program with multiple threads, each thread
iterate the sample foder and open/close the files in it, sometimes my
program hangs at open().
OS: Ubuntu 2.6.38-11 x86_64.
Is it a bug of fanotify that it does not support multiple-thread opening?
The code of my test program is attached.

I brought this problem on stackoverflow too:
http://stackoverflow.com/questions/7566755/multi-thread-opening-file-hangs-when-fanotify-is-on

Regards,
Boyd
```

## Attachments

- [thread\_open\_file.c](https://ratatoskr.run/linux-fsdevel/2011/09/57783/attachment/0) (text/x-csrc, 2190 bytes)
