diff options
author | Christoph Hellwig <hch@lst.de> | 2022-09-07 13:17:41 +0200 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2022-09-26 12:28:05 +0200 |
commit | bd86a532b26355695e87a6cf394d9c8bd24686c9 (patch) | |
tree | 0be8d9f63967a9e2c7d26a7ab95233316deaa37b /fs/btrfs/extent_io.c | |
parent | 23408d8196779f16f3bdcb592dd3820e07b6b119 (diff) |
btrfs: stop tracking failed reads in the I/O tree
There is a separate I/O failure tree to track the fail reads, so remove
the extra EXTENT_DAMAGED bit in the I/O tree as it's set but never used.
Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/extent_io.c')
-rw-r--r-- | fs/btrfs/extent_io.c | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index b503635e1e82..96546586785a 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c @@ -519,20 +519,14 @@ static struct io_failure_record *get_failrec(struct btrfs_inode *inode, u64 star return failrec; } -static int free_io_failure(struct btrfs_inode *inode, - struct io_failure_record *rec) +static void free_io_failure(struct btrfs_inode *inode, + struct io_failure_record *rec) { - int ret; - spin_lock(&inode->io_failure_lock); rb_erase(&rec->rb_node, &inode->io_failure_tree); spin_unlock(&inode->io_failure_lock); - ret = clear_extent_bits(&inode->io_tree, rec->bytenr, - rec->bytenr + rec->len - 1, - EXTENT_DAMAGED); kfree(rec); - return ret; } /* @@ -742,7 +736,6 @@ static struct io_failure_record *btrfs_get_io_failure_record(struct inode *inode struct btrfs_fs_info *fs_info = btrfs_sb(inode->i_sb); u64 start = bbio->file_offset + bio_offset; struct io_failure_record *failrec; - struct extent_io_tree *tree = &BTRFS_I(inode)->io_tree; const u32 sectorsize = fs_info->sectorsize; int ret; @@ -796,12 +789,6 @@ static struct io_failure_record *btrfs_get_io_failure_record(struct inode *inode kfree(failrec); return ERR_PTR(ret); } - ret = set_extent_bits(tree, start, start + sectorsize - 1, - EXTENT_DAMAGED); - if (ret) { - free_io_failure(BTRFS_I(inode), failrec); - return ERR_PTR(ret); - } return failrec; } |