Message ID | fd1306f8dfdf0ab4332eaf84ea54b6cfb6ebb0b6.1545126261.git.helmut.grohne@intenta.de |
---|---|
State | New, archived |
Delegated to: | Richard Weinberger |
Headers | show |
Series | [v3,1/3] jffs2: avoid unnecessarily taking f->sem | expand |
diff --git a/fs/jffs2/fs.c b/fs/jffs2/fs.c index eab04eca95a3..89a10b398d00 100644 --- a/fs/jffs2/fs.c +++ b/fs/jffs2/fs.c @@ -270,13 +270,15 @@ struct inode *jffs2_iget(struct super_block *sb, unsigned long ino) c = JFFS2_SB_INFO(inode->i_sb); jffs2_init_inode_info(f); - mutex_lock(&f->sem); ret = jffs2_do_read_inode(c, f, inode->i_ino, &latest_node); if (ret) goto error; inode->i_mode = jemode_to_cpu(latest_node.mode); + + mutex_lock(&f->sem); + i_uid_write(inode, je16_to_cpu(latest_node.uid)); i_gid_write(inode, je16_to_cpu(latest_node.gid)); inode->i_size = je32_to_cpu(latest_node.isize);