From: Christoph Hellwig Date: Wed, 27 Oct 2010 11:45:50 +0000 (+0200) Subject: hfsplus: free space correcly for files unlinked while open X-Git-Tag: v2.6.37-rc1~66^2 X-Git-Url: https://repo.jachan.dev/linux.git/commitdiff_plain/85b8fe8cc47b0dc1068475ba95f29ddff10a8efc 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 --- diff --git a/fs/hfsplus/dir.c b/fs/hfsplus/dir.c index d236d85ec9d7..e490aaf35174 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);