Skip to content

Commit

Permalink
hfsplus: free space correcly for files unlinked while open
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Christoph Hellwig authored and Christoph Hellwig committed Oct 27, 2010
1 parent e50fb58 commit 85b8fe8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion fs/hfsplus/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 85b8fe8

Please sign in to comment.