]> www.infradead.org Git - users/jedix/linux-maple.git/commit
eCryptfs: Copy up attributes of the lower target inode after rename
authorTyler Hicks <tyhicks@canonical.com>
Thu, 13 Sep 2012 19:00:56 +0000 (12:00 -0700)
committerGuangyu Sun <guangyu.sun@oracle.com>
Mon, 8 Oct 2012 17:00:07 +0000 (10:00 -0700)
commit668b00da4dc6836bbd5f15df56de72ae662a0511
tree9a33f16f3feacc039ed74dbe2aa1722c7aeef527
parent28b02c6d3e5e3deee8d99b1497635d12fbfba485
eCryptfs: Copy up attributes of the lower target inode after rename

commit 8335eafc2859e1a26282bef7c3d19f3d68868b8a upstream.

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.

http://launchpad.net/bugs/561129

Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
Tested-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Guangyu Sun <guangyu.sun@oracle.com>
fs/ecryptfs/inode.c