bcachefs: minor fsync fix

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
Kent Overstreet
2018-07-23 07:53:29 -04:00
committed by Kent Overstreet
parent 9c859dc91b
commit bb1b3658aa

View File

@@ -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_fs *c = inode->v.i_sb->s_fs_info;
int ret;
int ret, ret2;
ret = file_write_and_wait_range(file, start, end);
if (ret)
@@ -2123,7 +2123,10 @@ int bch2_fsync(struct file *file, loff_t start, loff_t end, int datasync)
if (c->opts.journal_flush_disabled)
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: */