]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - fs/ocfs2/namei.c
ocfs2: move nlink check in ocfs2_mknod()
[karo-tx-linux.git] / fs / ocfs2 / namei.c
index 0673862c8bdd24178f438f58840a06eec014b970..d8161a77c370ea39b4488d4e81ac2acd39000ab1 100644 (file)
@@ -310,13 +310,6 @@ static int ocfs2_mknod(struct inode *dir,
        /* get our super block */
        osb = OCFS2_SB(dir->i_sb);
 
-       if (S_ISDIR(mode) && (dir->i_nlink >= OCFS2_LINK_MAX)) {
-               mlog(ML_ERROR, "inode %llu has i_nlink of %u\n",
-                    (unsigned long long)OCFS2_I(dir)->ip_blkno, dir->i_nlink);
-               status = -EMLINK;
-               goto leave;
-       }
-
        handle = ocfs2_alloc_handle(osb);
        if (handle == NULL) {
                status = -ENOMEM;
@@ -331,6 +324,11 @@ static int ocfs2_mknod(struct inode *dir,
                goto leave;
        }
 
+       if (S_ISDIR(mode) && (dir->i_nlink >= OCFS2_LINK_MAX)) {
+               status = -EMLINK;
+               goto leave;
+       }
+
        dirfe = (struct ocfs2_dinode *) parent_fe_bh->b_data;
        if (!dirfe->i_links_count) {
                /* can't make a file in a deleted directory. */