Commit e7084c9c authored by Kent Overstreet's avatar Kent Overstreet Committed by Kent Overstreet

bcachefs: Make bch2_remap_range respect O_SYNC

Caught by xfstest generic/628
Signed-off-by: default avatarKent Overstreet <kent.overstreet@gmail.com>
parent d6462f49
......@@ -2941,6 +2941,11 @@ loff_t bch2_remap_file_range(struct file *file_src, loff_t pos_src,
if (pos_dst + ret > dst->v.i_size)
i_size_write(&dst->v, pos_dst + ret);
spin_unlock(&dst->v.i_lock);
if (((file_dst->f_flags & (__O_SYNC | O_DSYNC)) ||
IS_SYNC(file_inode(file_dst))) &&
!c->opts.journal_flush_disabled)
ret = bch2_journal_flush_seq(&c->journal, dst->ei_journal_seq);
err:
bch2_unlock_inodes(INODE_LOCK|INODE_PAGECACHE_BLOCK, src, dst);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment