From e50fb58b5b3548e578d3b74ff15aeb7d9a496839 Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Mon, 25 Oct 2010 20:39:07 +0200 Subject: hfsplus: fix double lock typo in ioctl This was supposed to be a mutex_unlock() instead of a mutex_lock(). Signed-off-by: Dan Carpenter Signed-off-by: Christoph Hellwig --- fs/hfsplus/ioctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'fs/hfsplus') diff --git a/fs/hfsplus/ioctl.c b/fs/hfsplus/ioctl.c index 5b4667e..40a85a3 100644 --- a/fs/hfsplus/ioctl.c +++ b/fs/hfsplus/ioctl.c @@ -92,7 +92,7 @@ static int hfsplus_ioctl_setflags(struct file *file, int __user *user_flags) mark_inode_dirty(inode); out_unlock_inode: - mutex_lock(&inode->i_mutex); + mutex_unlock(&inode->i_mutex); out_drop_write: mnt_drop_write(file->f_path.mnt); out: -- cgit v1.1 From 85b8fe8cc47b0dc1068475ba95f29ddff10a8efc Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Wed, 27 Oct 2010 13:45:50 +0200 Subject: 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 --- fs/hfsplus/dir.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'fs/hfsplus') diff --git a/fs/hfsplus/dir.c b/fs/hfsplus/dir.c index d236d85..e490aaf 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); -- cgit v1.1