Skip to content

Commit

Permalink
bcachefs: Fix fsync error reporting
Browse files Browse the repository at this point in the history
  • Loading branch information
koverstreet committed Apr 18, 2019
1 parent bf69eda commit 27c447e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions fs/bcachefs/fs-io.c
Original file line number Diff line number Diff line change
Expand Up @@ -1189,9 +1189,10 @@ static void bch2_writepage_io_done(struct closure *cl)
unsigned i;

if (io->op.op.error) {
bio_for_each_segment_all(bvec, bio, i)
bio_for_each_segment_all(bvec, bio, i) {
SetPageError(bvec->bv_page);
set_bit(AS_EIO, &io->op.inode->v.i_mapping->flags);
mapping_set_error(bvec->bv_page->mapping, -EIO);
}
}

/*
Expand Down Expand Up @@ -2079,10 +2080,9 @@ int bch2_fsync(struct file *file, loff_t start, loff_t end, int datasync)
if (ret)
return ret;
out:
if (c->opts.journal_flush_disabled)
return 0;

ret = bch2_journal_flush_seq(&c->journal, inode->ei_journal_seq);
if (!c->opts.journal_flush_disabled)
ret = bch2_journal_flush_seq(&c->journal,
inode->ei_journal_seq);
ret2 = file_check_and_advance_wb_err(file);

return ret ?: ret2;
Expand Down

0 comments on commit 27c447e

Please sign in to comment.