ocfs2: don't pass handle to ocfs2_meta_lock in ocfs2_symlink()
Take and drop the locks directly. Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com>
This commit is contained in:
@@ -1603,19 +1603,12 @@ static int ocfs2_symlink(struct inode *dir,
|
|||||||
|
|
||||||
credits = ocfs2_calc_symlink_credits(sb);
|
credits = ocfs2_calc_symlink_credits(sb);
|
||||||
|
|
||||||
handle = ocfs2_alloc_handle(osb);
|
|
||||||
if (handle == NULL) {
|
|
||||||
status = -ENOMEM;
|
|
||||||
mlog_errno(status);
|
|
||||||
goto bail;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* lock the parent directory */
|
/* lock the parent directory */
|
||||||
status = ocfs2_meta_lock(dir, handle, &parent_fe_bh, 1);
|
status = ocfs2_meta_lock(dir, NULL, &parent_fe_bh, 1);
|
||||||
if (status < 0) {
|
if (status < 0) {
|
||||||
if (status != -ENOENT)
|
if (status != -ENOENT)
|
||||||
mlog_errno(status);
|
mlog_errno(status);
|
||||||
goto bail;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
dirfe = (struct ocfs2_dinode *) parent_fe_bh->b_data;
|
dirfe = (struct ocfs2_dinode *) parent_fe_bh->b_data;
|
||||||
@@ -1638,6 +1631,13 @@ static int ocfs2_symlink(struct inode *dir,
|
|||||||
goto bail;
|
goto bail;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
handle = ocfs2_alloc_handle(osb);
|
||||||
|
if (handle == NULL) {
|
||||||
|
status = -ENOMEM;
|
||||||
|
mlog_errno(status);
|
||||||
|
goto bail;
|
||||||
|
}
|
||||||
|
|
||||||
status = ocfs2_reserve_new_inode(osb, handle, &inode_ac);
|
status = ocfs2_reserve_new_inode(osb, handle, &inode_ac);
|
||||||
if (status < 0) {
|
if (status < 0) {
|
||||||
if (status != -ENOSPC)
|
if (status != -ENOSPC)
|
||||||
@@ -1734,6 +1734,9 @@ static int ocfs2_symlink(struct inode *dir,
|
|||||||
bail:
|
bail:
|
||||||
if (handle)
|
if (handle)
|
||||||
ocfs2_commit_trans(handle);
|
ocfs2_commit_trans(handle);
|
||||||
|
|
||||||
|
ocfs2_meta_unlock(dir, 1);
|
||||||
|
|
||||||
if (new_fe_bh)
|
if (new_fe_bh)
|
||||||
brelse(new_fe_bh);
|
brelse(new_fe_bh);
|
||||||
if (parent_fe_bh)
|
if (parent_fe_bh)
|
||||||
|
Reference in New Issue
Block a user