Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 185722
b: refs/heads/master
c: e21e709
h: refs/heads/master
v: v3
  • Loading branch information
Al Viro committed Mar 3, 2010
1 parent a48bfeb commit 030f427
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 391e8bbd38474b9f85b1f3933394a79ea66fe1e2
refs/heads/master: e21e7095a78867364d7aa9223d833ccb966f93f3
15 changes: 9 additions & 6 deletions trunk/fs/hpfs/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -413,22 +413,25 @@ static int hpfs_unlink(struct inode *dir, struct dentry *dentry)

mutex_unlock(&hpfs_i(dir)->i_mutex);
mutex_unlock(&hpfs_i(inode)->i_parent_mutex);
d_drop(dentry);
spin_lock(&dentry->d_lock);
if (atomic_read(&dentry->d_count) > 1 ||
generic_permission(inode, MAY_WRITE, NULL) ||
dentry_unhash(dentry);
if (!d_unhashed(dentry)) {
dput(dentry);
unlock_kernel();
return -ENOSPC;
}
if (generic_permission(inode, MAY_WRITE, NULL) ||
!S_ISREG(inode->i_mode) ||
get_write_access(inode)) {
spin_unlock(&dentry->d_lock);
d_rehash(dentry);
dput(dentry);
} else {
struct iattr newattrs;
spin_unlock(&dentry->d_lock);
/*printk("HPFS: truncating file before delete.\n");*/
newattrs.ia_size = 0;
newattrs.ia_valid = ATTR_SIZE | ATTR_CTIME;
err = notify_change(dentry, &newattrs);
put_write_access(inode);
dput(dentry);
if (!err)
goto again;
}
Expand Down

0 comments on commit 030f427

Please sign in to comment.