aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ecryptfs/crypto.c
diff options
context:
space:
mode:
authorTyler Hicks <tyhicks@linux.vnet.ibm.com>2011-05-24 04:49:02 -0400
committerTyler Hicks <tyhicks@linux.vnet.ibm.com>2011-05-29 15:23:39 -0400
commit3b06b3ebf44170c90c893c6c80916db6e922b9f2 (patch)
tree1da70b311ad7ec7615f3d44ae269ca56a458fc2d /fs/ecryptfs/crypto.c
parent5ccf92037c7c6e6f28175fd245284923f939259f (diff)
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>
Diffstat (limited to 'fs/ecryptfs/crypto.c')
-rw-r--r--fs/ecryptfs/crypto.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/ecryptfs/crypto.c b/fs/ecryptfs/crypto.c
index b8d5c8091024..f48c4987a15c 100644
--- a/fs/ecryptfs/crypto.c
+++ b/fs/ecryptfs/crypto.c
@@ -1568,11 +1568,11 @@ out:
1568} 1568}
1569 1569
1570int ecryptfs_read_and_validate_xattr_region(char *page_virt, 1570int ecryptfs_read_and_validate_xattr_region(char *page_virt,
1571 struct dentry *ecryptfs_dentry) 1571 struct inode *inode)
1572{ 1572{
1573 int rc; 1573 int rc;
1574 1574
1575 rc = ecryptfs_read_xattr_region(page_virt, ecryptfs_dentry->d_inode); 1575 rc = ecryptfs_read_xattr_region(page_virt, inode);
1576 if (rc) 1576 if (rc)
1577 goto out; 1577 goto out;
1578 if (!contains_ecryptfs_marker(page_virt + ECRYPTFS_FILE_SIZE_BYTES)) { 1578 if (!contains_ecryptfs_marker(page_virt + ECRYPTFS_FILE_SIZE_BYTES)) {