aboutsummaryrefslogtreecommitdiffstats
path: root/fs/hpfs/namei.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/hpfs/namei.c')
-rw-r--r--fs/hpfs/namei.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/fs/hpfs/namei.c b/fs/hpfs/namei.c
index 1f05839c27a7..ff0ce21c0867 100644
--- a/fs/hpfs/namei.c
+++ b/fs/hpfs/namei.c
@@ -395,7 +395,6 @@ again:
395 395
396 dentry_unhash(dentry); 396 dentry_unhash(dentry);
397 if (!d_unhashed(dentry)) { 397 if (!d_unhashed(dentry)) {
398 dput(dentry);
399 hpfs_unlock(dir->i_sb); 398 hpfs_unlock(dir->i_sb);
400 return -ENOSPC; 399 return -ENOSPC;
401 } 400 }
@@ -403,7 +402,6 @@ again:
403 !S_ISREG(inode->i_mode) || 402 !S_ISREG(inode->i_mode) ||
404 get_write_access(inode)) { 403 get_write_access(inode)) {
405 d_rehash(dentry); 404 d_rehash(dentry);
406 dput(dentry);
407 } else { 405 } else {
408 struct iattr newattrs; 406 struct iattr newattrs;
409 /*printk("HPFS: truncating file before delete.\n");*/ 407 /*printk("HPFS: truncating file before delete.\n");*/
@@ -411,7 +409,6 @@ again:
411 newattrs.ia_valid = ATTR_SIZE | ATTR_CTIME; 409 newattrs.ia_valid = ATTR_SIZE | ATTR_CTIME;
412 err = notify_change(dentry, &newattrs); 410 err = notify_change(dentry, &newattrs);
413 put_write_access(inode); 411 put_write_access(inode);
414 dput(dentry);
415 if (!err) 412 if (!err)
416 goto again; 413 goto again;
417 } 414 }
@@ -442,6 +439,8 @@ static int hpfs_rmdir(struct inode *dir, struct dentry *dentry)
442 int err; 439 int err;
443 int r; 440 int r;
444 441
442 dentry_unhash(dentry);
443
445 hpfs_adjust_length(name, &len); 444 hpfs_adjust_length(name, &len);
446 hpfs_lock(dir->i_sb); 445 hpfs_lock(dir->i_sb);
447 err = -ENOENT; 446 err = -ENOENT;
@@ -535,6 +534,10 @@ static int hpfs_rename(struct inode *old_dir, struct dentry *old_dentry,
535 struct buffer_head *bh; 534 struct buffer_head *bh;
536 struct fnode *fnode; 535 struct fnode *fnode;
537 int err; 536 int err;
537
538 if (new_inode && S_ISDIR(new_inode->i_mode))
539 dentry_unhash(new_dentry);
540
538 if ((err = hpfs_chk_name(new_name, &new_len))) return err; 541 if ((err = hpfs_chk_name(new_name, &new_len))) return err;
539 err = 0; 542 err = 0;
540 hpfs_adjust_length(old_name, &old_len); 543 hpfs_adjust_length(old_name, &old_len);