]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: call mapping_set_error() on btree inode with a write error
authorJosef Bacik <josef@toxicpanda.com>
Wed, 24 Nov 2021 19:14:25 +0000 (14:14 -0500)
committerDavid Sterba <dsterba@suse.com>
Wed, 8 Dec 2021 14:42:32 +0000 (15:42 +0100)
commit784f7a03fce439d841c123abf55783568b9fd719
treec8c42072dddd4bb5d760ebef68a0ae0037d6f0de
parent77b57e093feffa20b14580e1fba3e67996a6fbfa
btrfs: call mapping_set_error() on btree inode with a write error

generic/484 fails sometimes with compression on because the write ends
up small enough that it goes into the btree.  This means that we never
call mapping_set_error() on the inode itself, because the page gets
marked as fine when we inline it into the metadata.  When the metadata
writeback happens we see it and abort the transaction properly and mark
the fs as readonly, however we don't do the mapping_set_error() on
anything.  In syncfs() we will simply return 0 if the sb is marked
read-only, so we can't check for this in our syncfs callback.  The only
way the error gets returned if we called mapping_set_error() on
something.  Fix this by calling mapping_set_error() on the btree inode
mapping.  This allows us to properly return an error on syncfs and pass
generic/484 with compression on.

Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/extent_io.c