projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d6462f4
)
bcachefs: Make bch2_remap_range respect O_SYNC
author
Kent Overstreet
<kent.overstreet@gmail.com>
Thu, 20 May 2021 01:21:49 +0000
(21:21 -0400)
committer
Kent Overstreet
<kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:09:04 +0000
(17:09 -0400)
Caught by xfstest generic/628
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
fs/bcachefs/fs-io.c
patch
|
blob
|
history
diff --git
a/fs/bcachefs/fs-io.c
b/fs/bcachefs/fs-io.c
index 763195ed0b3c5f552bdb535db698f9af406564b2..162f0eeb38df266ce275ca6a9b3b205a5b303c86 100644
(file)
--- a/
fs/bcachefs/fs-io.c
+++ b/
fs/bcachefs/fs-io.c
@@
-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);