diff --git a/[refs] b/[refs] index 971763a49a3c..46cd079b24a1 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: a663e30513d7ecc77dd71d474e7646bf78c0ba62 +refs/heads/master: 0f62de2c9ca60a35f63122e7ea992cee8aae4bef diff --git a/trunk/fs/ocfs2/namei.c b/trunk/fs/ocfs2/namei.c index d8161a77c370..24126476a8cc 100644 --- a/trunk/fs/ocfs2/namei.c +++ b/trunk/fs/ocfs2/namei.c @@ -641,11 +641,6 @@ static int ocfs2_link(struct dentry *old_dentry, goto bail; } - if (inode->i_nlink >= OCFS2_LINK_MAX) { - err = -EMLINK; - goto bail; - } - handle = ocfs2_alloc_handle(osb); if (handle == NULL) { err = -ENOMEM; @@ -659,6 +654,11 @@ static int ocfs2_link(struct dentry *old_dentry, goto bail; } + if (!dir->i_nlink) { + err = -ENOENT; + goto bail; + } + err = ocfs2_check_dir_for_entry(dir, dentry->d_name.name, dentry->d_name.len); if (err)