diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2021-11-06 12:46:36 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@gmail.com> | 2021-11-06 12:46:36 -0400 |
commit | abd9d5ba97a8a72508f85bb0fbf0120f07c453e1 (patch) | |
tree | 8c40391396eeb3cfea8dcfc7eeccc17a651e1991 /libbcachefs/xattr.c | |
parent | 5b84952401146fec9a181a40877352f7faf9ee7b (diff) |
Update bcachefs sources to 6afa1fcb13 bcachefs: Clean up error reporting in the startup path
Diffstat (limited to 'libbcachefs/xattr.c')
-rw-r--r-- | libbcachefs/xattr.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/libbcachefs/xattr.c b/libbcachefs/xattr.c index bb5da31..464ed68 100644 --- a/libbcachefs/xattr.c +++ b/libbcachefs/xattr.c @@ -165,8 +165,24 @@ int bch2_xattr_set(struct btree_trans *trans, subvol_inum inum, const char *name, const void *value, size_t size, int type, int flags) { + struct btree_iter inode_iter = { NULL }; + struct bch_inode_unpacked inode_u; int ret; + /* + * We need to do an inode update so that bi_journal_sync gets updated + * and fsync works: + * + * Perhaps we should be updating bi_mtime too? + */ + + ret = bch2_inode_peek(trans, &inode_iter, &inode_u, inum, BTREE_ITER_INTENT) ?: + bch2_inode_write(trans, &inode_iter, &inode_u); + bch2_trans_iter_exit(trans, &inode_iter); + + if (ret) + return ret; + if (value) { struct bkey_i_xattr *xattr; unsigned namelen = strlen(name); @@ -352,7 +368,7 @@ static int bch2_xattr_set_handler(const struct xattr_handler *handler, struct bch_fs *c = inode->v.i_sb->s_fs_info; struct bch_hash_info hash = bch2_hash_info_init(c, &inode->ei_inode); - return bch2_trans_do(c, NULL, &inode->ei_journal_seq, 0, + return bch2_trans_do(c, NULL, NULL, 0, bch2_xattr_set(&trans, inode_inum(inode), &hash, name, value, size, handler->flags, flags)); |