Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 53539
b: refs/heads/master
c: ee19a77
h: refs/heads/master
i:
  53537: 99a720d
  53535: 5e143be
v: v3
  • Loading branch information
Joel Becker authored and Mark Fasheh committed May 2, 2007
1 parent f2eaa59 commit bc33852
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6cb129f5675c39944e5fe18fd2530a2eb771b754
refs/heads/master: ee19a77956cb65c5da54d85a5efefe50b39fa6e5
7 changes: 6 additions & 1 deletion trunk/fs/ocfs2/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ static int ocfs2_extend_dir(struct ocfs2_super *osb,
struct buffer_head **new_de_bh)
{
int status = 0;
int credits, num_free_extents;
int credits, num_free_extents, drop_alloc_sem = 0;
loff_t dir_i_size;
struct ocfs2_dinode *fe = (struct ocfs2_dinode *) parent_fe_bh->b_data;
struct ocfs2_alloc_context *data_ac = NULL;
Expand Down Expand Up @@ -452,6 +452,9 @@ static int ocfs2_extend_dir(struct ocfs2_super *osb,
credits = OCFS2_SIMPLE_DIR_EXTEND_CREDITS;
}

down_write(&OCFS2_I(dir)->ip_alloc_sem);
drop_alloc_sem = 1;

handle = ocfs2_start_trans(osb, credits);
if (IS_ERR(handle)) {
status = PTR_ERR(handle);
Expand Down Expand Up @@ -497,6 +500,8 @@ static int ocfs2_extend_dir(struct ocfs2_super *osb,
*new_de_bh = new_bh;
get_bh(*new_de_bh);
bail:
if (drop_alloc_sem)
up_write(&OCFS2_I(dir)->ip_alloc_sem);
if (handle)
ocfs2_commit_trans(osb, handle);

Expand Down
2 changes: 2 additions & 0 deletions trunk/fs/ocfs2/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -1106,8 +1106,10 @@ struct buffer_head *ocfs2_bread(struct inode *inode,
return NULL;
}

down_read(&OCFS2_I(inode)->ip_alloc_sem);
tmperr = ocfs2_extent_map_get_blocks(inode, block, &p_blkno, NULL,
NULL);
up_read(&OCFS2_I(inode)->ip_alloc_sem);
if (tmperr < 0) {
mlog_errno(tmperr);
goto fail;
Expand Down

0 comments on commit bc33852

Please sign in to comment.