struct inode *inode;
struct fuse_inode *fi;
struct fuse_conn *fc = get_fuse_conn_super(sb);
+ bool is_new_inode = false;
/*
* Auto mount points get their node id from the submount root, which is
if (!inode)
return NULL;
- if ((inode_state_read_once(inode) & I_NEW)) {
+ is_new_inode = inode_state_read_once(inode) & I_NEW;
+ if (is_new_inode) {
inode->i_flags |= S_NOATIME;
if (!fc->writeback_cache || !S_ISREG(attr->mode))
inode->i_flags |= S_NOCMTIME;
inode->i_generation = generation;
fuse_init_inode(inode, attr, fc);
- unlock_new_inode(inode);
} else if (fuse_stale_inode(inode, generation, attr)) {
/* nodeid was reused, any I/O on the old inode should fail */
fuse_make_bad(inode);
done:
fuse_change_attributes_i(inode, attr, NULL, attr_valid, attr_version,
evict_ctr);
+ if (is_new_inode)
+ unlock_new_inode(inode);
return inode;
}