eCryptfs: Fix new inode race condition
Only unlock and d_add() new inodes after the plaintext inode size has been read from the lower filesystem. This fixes a race condition that was sometimes seen during a multi-job kernel build in an eCryptfs mount. https://bugzilla.kernel.org/show_bug.cgi?id=36002 Signed-off-by: Tyler Hicks <tyhicks@linux.vnet.ibm.com> Reported-by: David <david@unsolicited.net> Tested-by: David <david@unsolicited.net>
This commit is contained in:
@@ -191,7 +191,7 @@ static int ecryptfs_open(struct inode *inode, struct file *file)
|
||||
| ECRYPTFS_ENCRYPTED);
|
||||
}
|
||||
mutex_unlock(&crypt_stat->cs_mutex);
|
||||
rc = ecryptfs_get_lower_file(ecryptfs_dentry);
|
||||
rc = ecryptfs_get_lower_file(ecryptfs_dentry, inode);
|
||||
if (rc) {
|
||||
printk(KERN_ERR "%s: Error attempting to initialize "
|
||||
"the lower file for the dentry with name "
|
||||
|
Reference in New Issue
Block a user