Commit e3a82138 authored by Mark Fasheh's avatar Mark Fasheh

ocfs2: don't pass handle to ocfs2_meta_lock() in ocfs2_mknod()

Take and drop the locks directly.
Signed-off-by: default avatarMark Fasheh <mark.fasheh@oracle.com>
parent e08dc8b9
...@@ -333,16 +333,16 @@ static int ocfs2_mknod(struct inode *dir, ...@@ -333,16 +333,16 @@ static int ocfs2_mknod(struct inode *dir,
/* get our super block */ /* get our super block */
osb = OCFS2_SB(dir->i_sb); osb = OCFS2_SB(dir->i_sb);
handle = ocfs2_alloc_handle(osb); status = ocfs2_meta_lock(dir, NULL, &parent_fe_bh, 1);
if (handle == NULL) { if (status < 0) {
status = -ENOMEM; if (status != -ENOENT)
mlog_errno(status); mlog_errno(status);
goto leave; return status;
} }
status = ocfs2_meta_lock(dir, handle, &parent_fe_bh, 1); handle = ocfs2_alloc_handle(osb);
if (status < 0) { if (handle == NULL) {
if (status != -ENOENT) status = -ENOMEM;
mlog_errno(status); mlog_errno(status);
goto leave; goto leave;
} }
...@@ -455,6 +455,8 @@ static int ocfs2_mknod(struct inode *dir, ...@@ -455,6 +455,8 @@ static int ocfs2_mknod(struct inode *dir,
if (handle) if (handle)
ocfs2_commit_trans(handle); ocfs2_commit_trans(handle);
ocfs2_meta_unlock(dir, 1);
if (status == -ENOSPC) if (status == -ENOSPC)
mlog(0, "Disk is full\n"); mlog(0, "Disk is full\n");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment