eCryptfs: Copy up attributes of the lower target inode after rename
From: Tyler Hicks <firstname.lastname@example.org>
After calling into the lower filesystem to do a rename, the lower target
inode's attributes were not copied up to the eCryptfs target inode. This
resulted in the eCryptfs target inode staying around, rather than being
evicted, because i_nlink was not updated for the eCryptfs inode. This
also meant that eCryptfs didn't do the final iput() on the lower target
inode so it stayed around, as well. This would result in a failure to
free up space occupied by the target file in the rename() operation.
Both target inodes would eventually be evicted when the eCryptfs
filesystem was unmounted.
This patch calls fsstack_copy_attr_all() after the lower filesystem
does its ->rename() so that important inode attributes, such as i_nlink,
are updated at the eCryptfs layer. ecryptfs_evict_inode() is now called
and eCryptfs can drop its final reference on the lower inode.
Signed-off-by: Tyler Hicks <email@example.com>
Tested-by: Colin Ian King <firstname.lastname@example.org>
Cc: <email@example.com> [2.6.39+]
(upstream cherry pick 8335eafc2859e1a26282bef7c3d19f3d68868b8a)
Signed-off-by: Colin Ian King <firstname.lastname@example.org>
fs/ecryptfs/inode.c | 5 +++++
1 file changed, 5 insertions(+)