summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@tuxera.com>2010-10-27 13:45:50 +0200
committerChristoph Hellwig <hch@lst.de>2010-10-27 13:45:50 +0200
commit85b8fe8cc47b0dc1068475ba95f29ddff10a8efc (patch)
treeffda33b6caa6f32ac226ff49cfd8a18c186b68c1 /fs
parente50fb58b5b3548e578d3b74ff15aeb7d9a496839 (diff)
downloadlinux-3.10-85b8fe8cc47b0dc1068475ba95f29ddff10a8efc.tar.gz
linux-3.10-85b8fe8cc47b0dc1068475ba95f29ddff10a8efc.tar.bz2
linux-3.10-85b8fe8cc47b0dc1068475ba95f29ddff10a8efc.zip
hfsplus: free space correcly for files unlinked while open
hfsplus_delete_inode only truncates away all block allocations if i_nlink is zero. Make sure we properly drop the unlink count even when doing the rename hack for open but unlinked files. Signed-off-by: Christoph Hellwig <hch@tuxera.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/hfsplus/dir.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/hfsplus/dir.c b/fs/hfsplus/dir.c
index d236d85ec9d..e490aaf3517 100644
--- a/fs/hfsplus/dir.c
+++ b/fs/hfsplus/dir.c
@@ -317,8 +317,10 @@ static int hfsplus_unlink(struct inode *dir, struct dentry *dentry)
res = hfsplus_rename_cat(inode->i_ino,
dir, &dentry->d_name,
sbi->hidden_dir, &str);
- if (!res)
+ if (!res) {
inode->i_flags |= S_DEAD;
+ drop_nlink(inode);
+ }
goto out;
}
res = hfsplus_delete_cat(cnid, dir, &dentry->d_name);