diff options
Diffstat (limited to 'fs/ufs/inode.c')
-rw-r--r-- | fs/ufs/inode.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/fs/ufs/inode.c b/fs/ufs/inode.c index 488b5ff48afb..e7c8615beb65 100644 --- a/fs/ufs/inode.c +++ b/fs/ufs/inode.c | |||
@@ -843,14 +843,17 @@ int ufs_sync_inode (struct inode *inode) | |||
843 | 843 | ||
844 | void ufs_delete_inode (struct inode * inode) | 844 | void ufs_delete_inode (struct inode * inode) |
845 | { | 845 | { |
846 | loff_t old_i_size; | ||
847 | |||
846 | truncate_inode_pages(&inode->i_data, 0); | 848 | truncate_inode_pages(&inode->i_data, 0); |
847 | /*UFS_I(inode)->i_dtime = CURRENT_TIME;*/ | 849 | /*UFS_I(inode)->i_dtime = CURRENT_TIME;*/ |
848 | lock_kernel(); | 850 | lock_kernel(); |
849 | mark_inode_dirty(inode); | 851 | mark_inode_dirty(inode); |
850 | ufs_update_inode(inode, IS_SYNC(inode)); | 852 | ufs_update_inode(inode, IS_SYNC(inode)); |
853 | old_i_size = inode->i_size; | ||
851 | inode->i_size = 0; | 854 | inode->i_size = 0; |
852 | if (inode->i_blocks) | 855 | if (inode->i_blocks && ufs_truncate(inode, old_i_size)) |
853 | ufs_truncate (inode); | 856 | ufs_warning(inode->i_sb, __FUNCTION__, "ufs_truncate failed\n"); |
854 | ufs_free_inode (inode); | 857 | ufs_free_inode (inode); |
855 | unlock_kernel(); | 858 | unlock_kernel(); |
856 | } | 859 | } |