Skip to content

Commit

Permalink
Fully update inode when created
Browse files Browse the repository at this point in the history
When a new znode/inode pair is created both the znode and the inode
should be immediately updated to the correct values.  This was done
for the znode and for most of the values in the inode, but not all
of them.  This normally wasn't a problem because most subsequent
operations would cause the inode to be immediately updated.  This
change ensures the inode is now fully updated before it is inserted
in to the inode hash.

Closes #116
Closes #146
Closes #164
  • Loading branch information
behlendorf committed May 2, 2011
1 parent df554c1 commit 5f35b19
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions module/zfs/zfs_znode.c
Original file line number Diff line number Diff line change
Expand Up @@ -373,8 +373,7 @@ zfs_znode_alloc(zfs_sb_t *zsb, dmu_buf_t *db, int blksz,
}

ip->i_ino = obj;
ip->i_mode = zp->z_mode;
ip->i_mtime = ip->i_atime = ip->i_ctime = CURRENT_TIME_SEC;
zfs_inode_update(zp);
zfs_inode_set_ops(zsb, ip);

if (insert_inode_locked(ip))
Expand Down

0 comments on commit 5f35b19

Please sign in to comment.