Affects Version/s: Upstream
Fix Version/s: None
On the client when Lustre creates a file, we create the inode and instantiate the dentry in ll_create_it(), it's still hidden by lld->lld_invalid. Next lookup could discover it, however this brings an issue for some applications. like virus scanning, for example https://www.f-secure.com/en/web/business_global/downloads/linux-security
f-secure does real time scanning using fanotify. When client creates a file using open(2) with O_CREAT, the process will wait in fanotify until f-secure scanning thread does its job:
[<ffffffffc0a31506>] ll_atomic_open+0x1d6/0x11f0 [lustre]
The scanning thread will try to do lookup, the dcache lookup will fail because lld->lld_invalid, so it tries lookup_real, which requires i_mutex holding by the thread creating the file and waiting for the scanning thread.
Eventually scanning thread will be killed by f-secure after the timeout, and file creation could finish. Any thread tries to take i_mutex on the parent will block during the timeout.