diff options
-rw-r--r-- | fs/namei.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/namei.c b/fs/namei.c index 46af98ed136b..3b67be7631dc 100644 --- a/fs/namei.c +++ b/fs/namei.c | |||
@@ -2524,19 +2524,19 @@ int vfs_link(struct dentry *old_dentry, struct inode *dir, struct dentry *new_de | |||
2524 | return -EPERM; | 2524 | return -EPERM; |
2525 | if (!dir->i_op || !dir->i_op->link) | 2525 | if (!dir->i_op || !dir->i_op->link) |
2526 | return -EPERM; | 2526 | return -EPERM; |
2527 | if (S_ISDIR(old_dentry->d_inode->i_mode)) | 2527 | if (S_ISDIR(inode->i_mode)) |
2528 | return -EPERM; | 2528 | return -EPERM; |
2529 | 2529 | ||
2530 | error = security_inode_link(old_dentry, dir, new_dentry); | 2530 | error = security_inode_link(old_dentry, dir, new_dentry); |
2531 | if (error) | 2531 | if (error) |
2532 | return error; | 2532 | return error; |
2533 | 2533 | ||
2534 | mutex_lock(&old_dentry->d_inode->i_mutex); | 2534 | mutex_lock(&inode->i_mutex); |
2535 | DQUOT_INIT(dir); | 2535 | DQUOT_INIT(dir); |
2536 | error = dir->i_op->link(old_dentry, dir, new_dentry); | 2536 | error = dir->i_op->link(old_dentry, dir, new_dentry); |
2537 | mutex_unlock(&old_dentry->d_inode->i_mutex); | 2537 | mutex_unlock(&inode->i_mutex); |
2538 | if (!error) | 2538 | if (!error) |
2539 | fsnotify_link(dir, old_dentry->d_inode, new_dentry); | 2539 | fsnotify_link(dir, inode, new_dentry); |
2540 | return error; | 2540 | return error; |
2541 | } | 2541 | } |
2542 | 2542 | ||