]> git.baikalelectronics.ru Git - kernel.git/commit
eCryptfs: Unlink lower inode when ecryptfs_create() fails
authorTyler Hicks <tyhicks@canonical.com>
Tue, 22 May 2012 20:09:50 +0000 (15:09 -0500)
committerTyler Hicks <tyhicks@canonical.com>
Sun, 8 Jul 2012 17:51:44 +0000 (12:51 -0500)
commit5132d314ed62ea03d63fce5d2528d82220ff9dee
tree88e1eb6d53540891b82d2a861146b213442de205
parent4b59e79bec2c2c708439728a47d8e9cb887b3530
eCryptfs: Unlink lower inode when ecryptfs_create() fails

ecryptfs_create() creates a lower inode, allocates an eCryptfs inode,
initializes the eCryptfs inode and cryptographic metadata attached to
the inode, and then writes the metadata to the header of the file.

If an error was to occur after the lower inode was created, an empty
lower file would be left in the lower filesystem. This is a problem
because ecryptfs_open() refuses to open any lower files which do not
have the appropriate metadata in the file header.

This patch properly unlinks the lower inode when an error occurs in the
later stages of ecryptfs_create(), reducing the chance that an empty
lower file will be left in the lower filesystem.

https://launchpad.net/bugs/872905

Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
Cc: John Johansen <john.johansen@canonical.com>
Cc: Colin Ian King <colin.king@canonical.com>
fs/ecryptfs/inode.c