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

bcachefs: minor fsync fix

Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent 9c859dc9
...@@ -2107,7 +2107,7 @@ int bch2_fsync(struct file *file, loff_t start, loff_t end, int datasync) ...@@ -2107,7 +2107,7 @@ int bch2_fsync(struct file *file, loff_t start, loff_t end, int datasync)
{ {
struct bch_inode_info *inode = file_bch_inode(file); struct bch_inode_info *inode = file_bch_inode(file);
struct bch_fs *c = inode->v.i_sb->s_fs_info; struct bch_fs *c = inode->v.i_sb->s_fs_info;
int ret; int ret, ret2;
ret = file_write_and_wait_range(file, start, end); ret = file_write_and_wait_range(file, start, end);
if (ret) if (ret)
...@@ -2123,7 +2123,10 @@ int bch2_fsync(struct file *file, loff_t start, loff_t end, int datasync) ...@@ -2123,7 +2123,10 @@ int bch2_fsync(struct file *file, loff_t start, loff_t end, int datasync)
if (c->opts.journal_flush_disabled) if (c->opts.journal_flush_disabled)
return 0; return 0;
return bch2_journal_flush_seq(&c->journal, inode->ei_journal_seq); ret = bch2_journal_flush_seq(&c->journal, inode->ei_journal_seq);
ret2 = file_check_and_advance_wb_err(file);
return ret ?: ret2;
} }
/* truncate: */ /* truncate: */
......
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