Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 106359
b: refs/heads/master
c: 7e79eed
h: refs/heads/master
i:
  106357: 94b87e8
  106355: d734fca
  106351: 8b433d2
v: v3
  • Loading branch information
Tetsuo Handa authored and Al Viro committed Jul 27, 2008
1 parent d84af36 commit 3073a33
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 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: 2f1936b87783a3a56c9441b27b9ba7a747f11e8e
refs/heads/master: 7e79eedb3b22200cc8b774baea3a7bf28d766101
8 changes: 4 additions & 4 deletions trunk/fs/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -2524,19 +2524,19 @@ int vfs_link(struct dentry *old_dentry, struct inode *dir, struct dentry *new_de
return -EPERM;
if (!dir->i_op || !dir->i_op->link)
return -EPERM;
if (S_ISDIR(old_dentry->d_inode->i_mode))
if (S_ISDIR(inode->i_mode))
return -EPERM;

error = security_inode_link(old_dentry, dir, new_dentry);
if (error)
return error;

mutex_lock(&old_dentry->d_inode->i_mutex);
mutex_lock(&inode->i_mutex);
DQUOT_INIT(dir);
error = dir->i_op->link(old_dentry, dir, new_dentry);
mutex_unlock(&old_dentry->d_inode->i_mutex);
mutex_unlock(&inode->i_mutex);
if (!error)
fsnotify_link(dir, old_dentry->d_inode, new_dentry);
fsnotify_link(dir, inode, new_dentry);
return error;
}

Expand Down

0 comments on commit 3073a33

Please sign in to comment.