bcachefs: fix fsync after create

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
Kent Overstreet 2018-07-23 05:48:35 -04:00 committed by Kent Overstreet
parent 3142e7ef4b
commit 73ab6f356d

View file

@ -327,6 +327,7 @@ __bch2_create(struct mnt_idmap *idmap,
struct bch_inode_unpacked inode_u;
struct bch_hash_info hash_info;
struct posix_acl *default_acl = NULL, *acl = NULL;
u64 journal_seq = 0;
int ret;
bch2_inode_init(c, &inode_u, 0, 0, 0, rdev, &dir->ei_inode);
@ -391,7 +392,7 @@ __bch2_create(struct mnt_idmap *idmap,
&inode_u)
: 0) ?:
bch2_trans_commit(&trans, NULL, NULL,
&inode->ei_journal_seq,
&journal_seq,
BTREE_INSERT_ATOMIC|
BTREE_INSERT_NOUNLOCK);
if (ret == -EINTR)
@ -409,6 +410,7 @@ __bch2_create(struct mnt_idmap *idmap,
}
bch2_vfs_inode_init(c, inode, &inode_u);
journal_seq_copy(inode, journal_seq);
set_cached_acl(&inode->v, ACL_TYPE_ACCESS, acl);
set_cached_acl(&inode->v, ACL_TYPE_DEFAULT, default_acl);