Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 190557
b: refs/heads/master
c: a9743fc
h: refs/heads/master
i:
  190555: 605748f
v: v3
  • Loading branch information
Mark Fasheh committed Apr 23, 2010
1 parent eefb8e0 commit d2b553f
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 16 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: 062d340384dcf77dfd8de0a082b5da571de3925a
refs/heads/master: a9743fcdc0eb43d028b71267438076e1b0112ba0
40 changes: 25 additions & 15 deletions trunk/fs/ocfs2/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -408,23 +408,28 @@ static int ocfs2_mknod(struct inode *dir,
}
}

status = ocfs2_add_entry(handle, dentry, inode,
OCFS2_I(inode)->ip_blkno, parent_fe_bh,
&lookup);
if (status < 0) {
/*
* Do this before adding the entry to the directory. We add
* also set d_op after success so that ->d_iput() will cleanup
* the dentry lock even if ocfs2_add_entry() fails below.
*/
status = ocfs2_dentry_attach_lock(dentry, inode,
OCFS2_I(dir)->ip_blkno);
if (status) {
mlog_errno(status);
goto leave;
}
dentry->d_op = &ocfs2_dentry_ops;

status = ocfs2_dentry_attach_lock(dentry, inode,
OCFS2_I(dir)->ip_blkno);
if (status) {
status = ocfs2_add_entry(handle, dentry, inode,
OCFS2_I(inode)->ip_blkno, parent_fe_bh,
&lookup);
if (status < 0) {
mlog_errno(status);
goto leave;
}

insert_inode_hash(inode);
dentry->d_op = &ocfs2_dentry_ops;
d_instantiate(dentry, inode);
status = 0;
leave:
Expand Down Expand Up @@ -1777,22 +1782,27 @@ static int ocfs2_symlink(struct inode *dir,
}
}

status = ocfs2_add_entry(handle, dentry, inode,
le64_to_cpu(fe->i_blkno), parent_fe_bh,
&lookup);
if (status < 0) {
/*
* Do this before adding the entry to the directory. We add
* also set d_op after success so that ->d_iput() will cleanup
* the dentry lock even if ocfs2_add_entry() fails below.
*/
status = ocfs2_dentry_attach_lock(dentry, inode, OCFS2_I(dir)->ip_blkno);
if (status) {
mlog_errno(status);
goto bail;
}
dentry->d_op = &ocfs2_dentry_ops;

status = ocfs2_dentry_attach_lock(dentry, inode, OCFS2_I(dir)->ip_blkno);
if (status) {
status = ocfs2_add_entry(handle, dentry, inode,
le64_to_cpu(fe->i_blkno), parent_fe_bh,
&lookup);
if (status < 0) {
mlog_errno(status);
goto bail;
}

insert_inode_hash(inode);
dentry->d_op = &ocfs2_dentry_ops;
d_instantiate(dentry, inode);
bail:
if (status < 0 && did_quota)
Expand Down

0 comments on commit d2b553f

Please sign in to comment.