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:
@@ -1568,11 +1568,11 @@ out:
|
||||
}
|
||||
|
||||
int ecryptfs_read_and_validate_xattr_region(char *page_virt,
|
||||
struct dentry *ecryptfs_dentry)
|
||||
struct inode *inode)
|
||||
{
|
||||
int rc;
|
||||
|
||||
rc = ecryptfs_read_xattr_region(page_virt, ecryptfs_dentry->d_inode);
|
||||
rc = ecryptfs_read_xattr_region(page_virt, inode);
|
||||
if (rc)
|
||||
goto out;
|
||||
if (!contains_ecryptfs_marker(page_virt + ECRYPTFS_FILE_SIZE_BYTES)) {
|
||||
|
Reference in New Issue
Block a user