Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 95734
b: refs/heads/master
c: 590fe34
h: refs/heads/master
v: v3
  • Loading branch information
David Woodhouse committed May 1, 2008
1 parent e1f3dfb commit ed28d54
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 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: 4e571aba7bb25a3a069a7b88c0f63fe5a14c05c6
refs/heads/master: 590fe34c47cb5c2d836ac76fabc5f160bf31a3f1
7 changes: 7 additions & 0 deletions trunk/fs/jffs2/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,13 @@ static int jffs2_create(struct inode *dir_i, struct dentry *dentry, int mode,
f = JFFS2_INODE_INFO(inode);
dir_f = JFFS2_INODE_INFO(dir_i);

/* jffs2_do_create() will want to lock it, _after_ reserving
space and taking c-alloc_sem. If we keep it locked here,
lockdep gets unhappy (although it's a false positive;
nothing else will be looking at this inode yet so there's
no chance of AB-BA deadlock involving its f->sem). */
mutex_unlock(&f->sem);

ret = jffs2_do_create(c, dir_f, f, ri,
dentry->d_name.name, dentry->d_name.len);
if (ret)
Expand Down
6 changes: 3 additions & 3 deletions trunk/fs/jffs2/write.c
Original file line number Diff line number Diff line change
Expand Up @@ -438,10 +438,10 @@ int jffs2_do_create(struct jffs2_sb_info *c, struct jffs2_inode_info *dir_f, str
ret = jffs2_reserve_space(c, sizeof(*ri), &alloclen, ALLOC_NORMAL,
JFFS2_SUMMARY_INODE_SIZE);
D1(printk(KERN_DEBUG "jffs2_do_create(): reserved 0x%x bytes\n", alloclen));
if (ret) {
mutex_unlock(&f->sem);
if (ret)
return ret;
}

mutex_lock(&f->sem);

ri->data_crc = cpu_to_je32(0);
ri->node_crc = cpu_to_je32(crc32(0, ri, sizeof(*ri)-8));
Expand Down

0 comments on commit ed28d54

Please sign in to comment.