summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2019-04-17 20:34:24 -0400
committerKent Overstreet <kent.overstreet@gmail.com>2019-06-10 14:08:03 -0400
commitcaa0d16b449cdb7ed3d5479e4f0e935cb5d5f5a6 (patch)
treee34a81c5531d6aa7a7be2def5f64227b173b5a79
parentd6e266179440544f324c05e6601703e4386176ce (diff)
bcachefs: Fix fsync error reporting
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
-rw-r--r--fs/bcachefs/fs-io.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/fs/bcachefs/fs-io.c b/fs/bcachefs/fs-io.c
index 0f26a268ce5b..81b0a3fac2dd 100644
--- a/fs/bcachefs/fs-io.c
+++ b/fs/bcachefs/fs-io.c
@@ -1154,9 +1154,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);
+ }
}
/*
@@ -2044,10 +2045,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;