summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/extent_io.c
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2021-12-17 01:13:19 +0100
committerJakub Kicinski <kuba@kernel.org>2021-12-17 01:13:19 +0100
commit7cd2802d7496c1fc76f42dc045b48cc16d11df39 (patch)
tree41c33f5944bbc686a489801762eb126e07049b81 /fs/btrfs/extent_io.c
parentMerge branch 'fib-merge-nl-policies' (diff)
parentMerge tag 'audit-pr-20211216' of git://git.kernel.org/pub/scm/linux/kernel/gi... (diff)
downloadlinux-7cd2802d7496c1fc76f42dc045b48cc16d11df39.tar.xz
linux-7cd2802d7496c1fc76f42dc045b48cc16d11df39.zip
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
No conflicts. Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'fs/btrfs/extent_io.c')
-rw-r--r--fs/btrfs/extent_io.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
index 4e03a6d3aa32..3258b6f01e85 100644
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_io.c
@@ -4314,6 +4314,20 @@ static void set_btree_ioerr(struct page *page, struct extent_buffer *eb)
return;
/*
+ * A read may stumble upon this buffer later, make sure that it gets an
+ * error and knows there was an error.
+ */
+ clear_bit(EXTENT_BUFFER_UPTODATE, &eb->bflags);
+
+ /*
+ * We need to set the mapping with the io error as well because a write
+ * error will flip the file system readonly, and then syncfs() will
+ * return a 0 because we are readonly if we don't modify the err seq for
+ * the superblock.
+ */
+ mapping_set_error(page->mapping, -EIO);
+
+ /*
* If we error out, we should add back the dirty_metadata_bytes
* to make it consistent.
*/