Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 062d3403 authored by Li Dongyang's avatar Li Dongyang Committed by Mark Fasheh
Browse files

ocfs2: use OCFS2_INODE_SKIP_ORPHAN_DIR in ocfs2_mknod error path



Mark the inode with flag OCFS2_INODE_SKIP_ORPHAN_DIR in ocfs2_mknod, so we
can kill the inode in case of error.

[ Fixed up comment style -Mark ]

Signed-off-by: default avatarLi Dongyang <lidongyang@novell.com>
Signed-off-by: default avatarMark Fasheh <mfasheh@suse.com>
parent ab41fdc8
Loading
Loading
Loading
Loading
+11 −5
Original line number Diff line number Diff line
@@ -445,11 +445,6 @@ static int ocfs2_mknod(struct inode *dir,

	ocfs2_free_dir_lookup_result(&lookup);

	if ((status < 0) && inode) {
		clear_nlink(inode);
		iput(inode);
	}

	if (inode_ac)
		ocfs2_free_alloc_context(inode_ac);

@@ -459,6 +454,17 @@ static int ocfs2_mknod(struct inode *dir,
	if (meta_ac)
		ocfs2_free_alloc_context(meta_ac);

	/*
	 * We should call iput after the i_mutex of the bitmap been
	 * unlocked in ocfs2_free_alloc_context, or the
	 * ocfs2_delete_inode will mutex_lock again.
	 */
	if ((status < 0) && inode) {
		OCFS2_I(inode)->ip_flags |= OCFS2_INODE_SKIP_ORPHAN_DIR;
		clear_nlink(inode);
		iput(inode);
	}

	mlog_exit(status);

	return status;