]> git.hungrycats.org Git - linux/commitdiff
zygo: fs/btrfs: make noise for EIO: mass convert all the instances
authorZygo Blaxell <zblaxell@serenity.furryterror.org>
Sat, 15 Aug 2015 15:46:23 +0000 (11:46 -0400)
committerZygo Blaxell <zblaxell@serenity.furryterror.org>
Sat, 15 Aug 2015 15:46:23 +0000 (11:46 -0400)
25 files changed:
fs/btrfs/acl.c
fs/btrfs/backref.c
fs/btrfs/compression.c
fs/btrfs/ctree.c
fs/btrfs/delayed-inode.c
fs/btrfs/dev-replace.c
fs/btrfs/disk-io.c
fs/btrfs/extent-tree.c
fs/btrfs/extent_io.c
fs/btrfs/extent_io.h
fs/btrfs/file.c
fs/btrfs/free-space-cache.c
fs/btrfs/inode.c
fs/btrfs/ioctl.c
fs/btrfs/lzo.c
fs/btrfs/ordered-data.c
fs/btrfs/raid56.c
fs/btrfs/relocation.c
fs/btrfs/scrub.c
fs/btrfs/send.c
fs/btrfs/super.c
fs/btrfs/transaction.c
fs/btrfs/tree-log.c
fs/btrfs/volumes.c
fs/btrfs/zlib.c

index 9a0124a95851014c9000ed7822dc5fad0a2f6995..6fc347d3597a21c14537cc543b7bdbdc85f5f94a 100644 (file)
@@ -59,7 +59,7 @@ struct posix_acl *btrfs_get_acl(struct inode *inode, int type)
                /* FIXME, who returns -ENOENT?  I think nobody */
                acl = NULL;
        } else {
-               acl = ERR_PTR(-EIO);
+               acl = ERR_PTR(-EIEIO);
        }
        kfree(value);
 
index 11de396849e23080b12117615aefe2cec2f175f0..ae2997748c961664505f8c446b7e4ec77f04b43a 100644 (file)
@@ -516,7 +516,7 @@ static int __add_missing_keys(struct btrfs_fs_info *fs_info,
                                     0);
                if (!eb || !extent_buffer_uptodate(eb)) {
                        free_extent_buffer(eb);
-                       return -EIO;
+                       return -EIEIO;
                }
                btrfs_tree_read_lock(eb);
                if (btrfs_header_level(eb) == 0)
@@ -1059,7 +1059,7 @@ again:
                                                           ref->parent, 0);
                                if (!eb || !extent_buffer_uptodate(eb)) {
                                        free_extent_buffer(eb);
-                                       ret = -EIO;
+                                       ret = -EIEIO;
                                        goto out;
                                }
                                btrfs_tree_read_lock(eb);
@@ -1506,7 +1506,7 @@ int extent_from_logical(struct btrfs_fs_info *fs_info, u64 logical,
                return 0;
        }
 
-       return -EIO;
+       return -EIEIO;
 }
 
 /*
index ce62324c78e7dbc734a2793c39a89de38238e27b..63909a689c4681eddefcc26fe40e0c9465ae68c9 100644 (file)
@@ -131,7 +131,7 @@ static int check_compressed_csum(struct inode *inode,
                           "csum failed ino %llu extent %llu csum %u wanted %u mirror %d",
                           btrfs_ino(inode), disk_start, csum, *cb_sum,
                           cb->mirror_num);
-                       ret = -EIO;
+                       ret = -EIEIO;
                        goto fail;
                }
                cb_sum++;
@@ -235,7 +235,7 @@ static noinline void end_compressed_writeback(struct inode *inode,
        int ret;
 
        if (cb->errors)
-               mapping_set_error(inode->i_mapping, -EIO);
+               mapping_set_error(inode->i_mapping, -EIEIO);
 
        while (nr_pages > 0) {
                ret = find_get_pages_contig(inode->i_mapping, index,
@@ -596,7 +596,7 @@ int btrfs_submit_compressed_read(struct inode *inode, struct bio *bio,
                                   PAGE_CACHE_SIZE);
        read_unlock(&em_tree->lock);
        if (!em)
-               return -EIO;
+               return -EIEIO;
 
        compressed_len = em->block_len;
        cb = kmalloc(compressed_bio_size(root, compressed_len), GFP_NOFS);
index 0f11ebc92f02ac69ffe3302624852cf9e467656a..56872aacc14b77389f325a667bebdb36a21ff12e 100644 (file)
@@ -1687,7 +1687,7 @@ int btrfs_realloc_node(struct btrfs_trans_handle *trans,
                                cur = read_tree_block(root, blocknr, gen);
                                if (!cur || !extent_buffer_uptodate(cur)) {
                                        free_extent_buffer(cur);
-                                       return -EIO;
+                                       return -EIEIO;
                                }
                        } else if (!uptodate) {
                                err = btrfs_read_buffer(cur, gen);
@@ -2473,7 +2473,7 @@ read_block_for_search(struct btrfs_trans_handle *trans,
                }
                free_extent_buffer(tmp);
                btrfs_release_path(p);
-               return -EIO;
+               return -EIEIO;
        }
 
        /*
@@ -2497,12 +2497,12 @@ read_block_for_search(struct btrfs_trans_handle *trans,
        if (tmp) {
                /*
                 * If the read above didn't mark this buffer up to date,
-                * it will never end up being up to date.  Set ret to EIO now
+                * it will never end up being up to date.  Set ret to EIEIO now
                 * and give up so that our caller doesn't loop forever
                 * on our EAGAINs.
                 */
                if (!btrfs_buffer_uptodate(tmp, 0, 0))
-                       ret = -EIO;
+                       ret = -EIEIO;
                free_extent_buffer(tmp);
        }
        return ret;
index a2ae42720a6afe92701de402b837d56dd66d03b4..c00a830724275ad4dd5044e739a67245bfaa5343 100644 (file)
@@ -1166,7 +1166,7 @@ static int __btrfs_run_delayed_items(struct btrfs_trans_handle *trans,
        bool count = (nr > 0);
 
        if (trans->aborted)
-               return -EIO;
+               return -EIEIO;
 
        path = btrfs_alloc_path();
        if (!path)
index 0573848c73337f2f7848dfdd2fd05e31d5f26a56..1250263f3c494f8885bbb9216e1d29a662ace883 100644 (file)
@@ -146,7 +146,7 @@ no_valid_dev_replace_entry_found:
                 */
                if (!dev_replace->srcdev &&
                    !btrfs_test_opt(dev_root, DEGRADED)) {
-                       ret = -EIO;
+                       ret = -EIEIO;
                        btrfs_warn(fs_info,
                           "cannot mount because device replace operation is ongoing and");
                        btrfs_warn(fs_info,
@@ -155,7 +155,7 @@ no_valid_dev_replace_entry_found:
                }
                if (!dev_replace->tgtdev &&
                    !btrfs_test_opt(dev_root, DEGRADED)) {
-                       ret = -EIO;
+                       ret = -EIEIO;
                        btrfs_warn(fs_info,
                           "cannot mount because device replace operation is ongoing and");
                        btrfs_warn(fs_info,
index 2ef9a4b72d06e46d4f3a19c73e94796cb8397347..842f63a87dded221715026de200763c89d248b80 100644 (file)
@@ -249,7 +249,7 @@ static struct extent_map *btree_get_extent(struct inode *inode,
                free_extent_map(em);
                em = lookup_extent_mapping(em_tree, start, len);
                if (!em)
-                       em = ERR_PTR(-EIO);
+                       em = ERR_PTR(-EIEIO);
        } else if (ret) {
                free_extent_map(em);
                em = ERR_PTR(ret);
@@ -456,7 +456,7 @@ static int btree_read_extent_buffer_pages(struct btrfs_root *root,
                                                   parent_transid, 0))
                                break;
                        else
-                               ret = -EIO;
+                               ret = -EIEIO;
                }
 
                /*
@@ -550,7 +550,7 @@ static noinline int check_leaf(struct btrfs_root *root,
        if (btrfs_item_offset_nr(leaf, 0) + btrfs_item_size_nr(leaf, 0) !=
            BTRFS_LEAF_DATA_SIZE(root)) {
                CORRUPT("invalid item offset size pair", leaf, root, 0);
-               return -EIO;
+               return -EIEIO;
        }
 
        /*
@@ -567,7 +567,7 @@ static noinline int check_leaf(struct btrfs_root *root,
                /* Make sure the keys are in the right order */
                if (btrfs_comp_cpu_keys(&leaf_key, &key) >= 0) {
                        CORRUPT("bad key order", leaf, root, slot);
-                       return -EIO;
+                       return -EIEIO;
                }
 
                /*
@@ -578,7 +578,7 @@ static noinline int check_leaf(struct btrfs_root *root,
                if (btrfs_item_offset_nr(leaf, slot) !=
                        btrfs_item_end_nr(leaf, slot + 1)) {
                        CORRUPT("slot offset bad", leaf, root, slot);
-                       return -EIO;
+                       return -EIEIO;
                }
 
                /*
@@ -589,7 +589,7 @@ static noinline int check_leaf(struct btrfs_root *root,
                if (btrfs_item_end_nr(leaf, slot) >
                    BTRFS_LEAF_DATA_SIZE(root)) {
                        CORRUPT("slot end outside of leaf", leaf, root, slot);
-                       return -EIO;
+                       return -EIEIO;
                }
        }
 
@@ -623,7 +623,7 @@ static int btree_readpage_end_io_hook(struct btrfs_io_bio *io_bio,
 
        eb->read_mirror = mirror;
        if (test_bit(EXTENT_BUFFER_READ_ERR, &eb->bflags)) {
-               ret = -EIO;
+               ret = -EIEIO;
                goto err;
        }
 
@@ -632,20 +632,20 @@ static int btree_readpage_end_io_hook(struct btrfs_io_bio *io_bio,
                printk_ratelimited(KERN_ERR "BTRFS (device %s): bad tree block start "
                               "%llu %llu\n",
                               eb->fs_info->sb->s_id, found_start, eb->start);
-               ret = -EIO;
+               ret = -EIEIO;
                goto err;
        }
        if (check_tree_block_fsid(root->fs_info, eb)) {
                printk_ratelimited(KERN_ERR "BTRFS (device %s): bad fsid on block %llu\n",
                               eb->fs_info->sb->s_id, eb->start);
-               ret = -EIO;
+               ret = -EIEIO;
                goto err;
        }
        found_level = btrfs_header_level(eb);
        if (found_level >= BTRFS_MAX_LEVEL) {
                btrfs_err(root->fs_info, "bad tree block level %d",
                           (int)btrfs_header_level(eb));
-               ret = -EIO;
+               ret = -EIEIO;
                goto err;
        }
 
@@ -654,18 +654,18 @@ static int btree_readpage_end_io_hook(struct btrfs_io_bio *io_bio,
 
        ret = csum_tree_block(root->fs_info, eb, 1);
        if (ret) {
-               ret = -EIO;
+               ret = -EIEIO;
                goto err;
        }
 
        /*
         * If this is a leaf block and it is corrupt, set the corrupt bit so
         * that we don't try and read the other copies of this block, just
-        * return -EIO.
+        * return -EIEIO.
         */
        if (found_level == 0 && check_leaf(root, eb)) {
                set_bit(EXTENT_BUFFER_CORRUPT, &eb->bflags);
-               ret = -EIO;
+               ret = -EIEIO;
        }
 
        if (!ret)
@@ -699,8 +699,8 @@ static int btree_io_failed_hook(struct page *page, int failed_mirror)
        eb->read_mirror = failed_mirror;
        atomic_dec(&eb->io_pages);
        if (test_and_clear_bit(EXTENT_BUFFER_READAHEAD, &eb->bflags))
-               btree_readahead_hook(root, eb, eb->start, -EIO);
-       return -EIO;    /* we fixed nothing */
+               btree_readahead_hook(root, eb, eb->start, -EIEIO);
+       return -EIEIO;  /* we fixed nothing */
 }
 
 static void end_workqueue_bio(struct bio *bio, int err)
@@ -1105,7 +1105,7 @@ int reada_tree_block_flagged(struct btrfs_root *root, u64 bytenr,
 
        if (test_bit(EXTENT_BUFFER_CORRUPT, &buf->bflags)) {
                free_extent_buffer(buf);
-               return -EIO;
+               return -EIEIO;
        } else if (extent_buffer_uptodate(buf)) {
                *eb = buf;
        } else {
@@ -1513,7 +1513,7 @@ static struct btrfs_root *btrfs_read_tree_root(struct btrfs_root *tree_root,
                ret = -ENOMEM;
                goto find_fail;
        } else if (!btrfs_buffer_uptodate(root->node, generation, 0)) {
-               ret = -EIO;
+               ret = -EIEIO;
                goto read_fail;
        }
        root->commit_root = btrfs_root_node(root);
@@ -2307,7 +2307,7 @@ static int btrfs_replay_log(struct btrfs_fs_info *fs_info,
        if (fs_devices->rw_devices == 0) {
                printk(KERN_WARNING "BTRFS: log replay required "
                       "on RO media\n");
-               return -EIO;
+               return -EIEIO;
        }
 
        log_tree_root = btrfs_alloc_root(fs_info);
@@ -2325,7 +2325,7 @@ static int btrfs_replay_log(struct btrfs_fs_info *fs_info,
                printk(KERN_ERR "BTRFS: failed to read log tree\n");
                free_extent_buffer(log_tree_root->node);
                kfree(log_tree_root);
-               return -EIO;
+               return -EIEIO;
        }
        /* returns with log_tree_root freed on success */
        ret = btrfs_recover_log_trees(log_tree_root);
@@ -3306,7 +3306,7 @@ static int write_dev_flush(struct btrfs_device *device, int wait)
                                      rcu_str_deref(device->name));
                        device->nobarriers = 1;
                } else if (!bio_flagged(bio, BIO_UPTODATE)) {
-                       ret = -EIO;
+                       ret = -EIEIO;
                        btrfs_dev_stat_inc_and_print(device,
                                BTRFS_DEV_STAT_FLUSH_ERRS);
                }
@@ -3385,7 +3385,7 @@ static int barrier_all_devices(struct btrfs_fs_info *info)
        }
        if (errors_send > info->num_tolerated_disk_barrier_failures ||
            errors_wait > info->num_tolerated_disk_barrier_failures)
-               return -EIO;
+               return -EIEIO;
        return 0;
 }
 
@@ -3534,9 +3534,9 @@ static int write_all_supers(struct btrfs_root *root, int max_mirrors)
                mutex_unlock(&root->fs_info->fs_devices->device_list_mutex);
 
                /* FUA is masked off if unsupported and can't be the reason */
-               btrfs_error(root->fs_info, -EIO,
+               btrfs_error(root->fs_info, -EIEIO,
                            "%d errors while writing supers", total_errors);
-               return -EIO;
+               return -EIEIO;
        }
 
        total_errors = 0;
@@ -3552,9 +3552,9 @@ static int write_all_supers(struct btrfs_root *root, int max_mirrors)
        }
        mutex_unlock(&root->fs_info->fs_devices->device_list_mutex);
        if (total_errors > max_errors) {
-               btrfs_error(root->fs_info, -EIO,
+               btrfs_error(root->fs_info, -EIEIO,
                            "%d errors while writing supers", total_errors);
-               return -EIO;
+               return -EIEIO;
        }
        return 0;
 }
index 0ec3acd14cbf5e1273f331231f09165710d80d91..825e256416b00695b52228fdb4f0a648b1c258e8 100644 (file)
@@ -1546,7 +1546,7 @@ again:
                err = -ENOENT;
                goto out;
        } else if (WARN_ON(ret)) {
-               err = -EIO;
+               err = -EIEIO;
                goto out;
        }
 
@@ -1917,7 +1917,7 @@ int btrfs_discard_extent(struct btrfs_root *root, u64 bytenr,
                        if (!ret)
                                discarded_bytes += stripe->length;
                        else if (ret != -EOPNOTSUPP)
-                               break; /* Logic errors or -ENOMEM, or -EIO but I don't know how that could happen JDM */
+                               break; /* Logic errors or -ENOMEM, or -EIEIO but I don't know how that could happen JDM */
 
                        /*
                         * Just in case we get back EOPNOTSUPP for some reason,
@@ -2186,7 +2186,7 @@ again:
                                goto again;
                        }
                } else {
-                       err = -EIO;
+                       err = -EIEIO;
                        goto out;
                }
        }
@@ -2349,7 +2349,7 @@ select_delayed_ref(struct btrfs_delayed_ref_head *head)
 
 /*
  * Returns 0 on success or if called with an already aborted transaction.
- * Returns -ENOMEM or -EIO on failure and will abort the transaction.
+ * Returns -ENOMEM or -EIEIO on failure and will abort the transaction.
  */
 static noinline int __btrfs_run_delayed_refs(struct btrfs_trans_handle *trans,
                                             struct btrfs_root *root,
@@ -6578,11 +6578,11 @@ wait_block_group_cache_done(struct btrfs_block_group_cache *cache)
 
        caching_ctl = get_caching_control(cache);
        if (!caching_ctl)
-               return (cache->cached == BTRFS_CACHE_ERROR) ? -EIO : 0;
+               return (cache->cached == BTRFS_CACHE_ERROR) ? -EIEIO : 0;
 
        wait_event(caching_ctl->wait, block_group_cache_done(cache));
        if (cache->cached == BTRFS_CACHE_ERROR)
-               ret = -EIO;
+               ret = -EIEIO;
        put_caching_control(caching_ctl);
        return ret;
 }
@@ -7921,7 +7921,7 @@ walk_down:
 
                        eb = read_tree_block(root, child_bytenr, child_gen);
                        if (!eb || !extent_buffer_uptodate(eb)) {
-                               ret = -EIO;
+                               ret = -EIEIO;
                                goto out;
                        }
 
@@ -8153,7 +8153,7 @@ static noinline int do_walk_down(struct btrfs_trans_handle *trans,
                next = read_tree_block(root, bytenr, generation);
                if (!next || !extent_buffer_uptodate(next)) {
                        free_extent_buffer(next);
-                       return -EIO;
+                       return -EIEIO;
                }
                btrfs_tree_lock(next);
                btrfs_set_lock_blocking(next);
@@ -9891,7 +9891,7 @@ int btrfs_remove_block_group(struct btrfs_trans_handle *trans,
 
        ret = btrfs_search_slot(trans, root, &key, path, -1, 1);
        if (ret > 0)
-               ret = -EIO;
+               ret = -EIEIO;
        if (ret < 0)
                goto out;
 
index 856c2e8ea6acd8b03f0eae1de196fc120529b5e9..816161d4a5bb81212d2e415e138d203ee0016d2c 100644 (file)
@@ -1775,7 +1775,7 @@ int extent_clear_unlock_delalloc(struct inode *inode, u64 start, u64 end,
                return 0;
 
        if ((page_ops & PAGE_SET_ERROR) && nr_pages > 0)
-               mapping_set_error(inode->i_mapping, -EIO);
+               mapping_set_error(inode->i_mapping, -EIEIO);
 
        while (nr_pages > 0) {
                ret = find_get_pages_contig(inode->i_mapping, index,
@@ -2049,7 +2049,7 @@ int repair_io_failure(struct inode *inode, u64 start, u64 length, u64 logical,
 
        bio = btrfs_io_bio_alloc(GFP_NOFS, 1);
        if (!bio)
-               return -EIO;
+               return -EIEIO;
        bio->bi_iter.bi_size = 0;
        map_length = length;
 
@@ -2057,7 +2057,7 @@ int repair_io_failure(struct inode *inode, u64 start, u64 length, u64 logical,
                              &map_length, &bbio, mirror_num);
        if (ret) {
                bio_put(bio);
-               return -EIO;
+               return -EIEIO;
        }
        BUG_ON(mirror_num != bbio->mirror_num);
        sector = bbio->stripes[mirror_num-1].physical >> 9;
@@ -2066,7 +2066,7 @@ int repair_io_failure(struct inode *inode, u64 start, u64 length, u64 logical,
        btrfs_put_bbio(bbio);
        if (!dev || !dev->bdev || !dev->writeable) {
                bio_put(bio);
-               return -EIO;
+               return -EIEIO;
        }
        bio->bi_bdev = dev->bdev;
        bio_add_page(bio, page, length, pg_offset);
@@ -2075,7 +2075,7 @@ int repair_io_failure(struct inode *inode, u64 start, u64 length, u64 logical,
                /* try to remap that extent elsewhere? */
                bio_put(bio);
                btrfs_dev_stat_inc_and_print(dev, BTRFS_DEV_STAT_WRITE_ERRS);
-               return -EIO;
+               return -EIEIO;
        }
 
        printk_ratelimited_in_rcu(KERN_INFO
@@ -2234,7 +2234,7 @@ int btrfs_get_io_failure_record(struct inode *inode, u64 start, u64 end,
                if (!em) {
                        read_unlock(&em_tree->lock);
                        kfree(failrec);
-                       return -EIO;
+                       return -EIEIO;
                }
 
                if (em->start > start || em->start + em->len <= start) {
@@ -2244,7 +2244,7 @@ int btrfs_get_io_failure_record(struct inode *inode, u64 start, u64 end,
                read_unlock(&em_tree->lock);
                if (!em) {
                        kfree(failrec);
-                       return -EIO;
+                       return -EIEIO;
                }
 
                logical = start - em->start;
@@ -2419,7 +2419,7 @@ static int bio_readpage_error(struct bio *failed_bio, u64 phy_offset,
        ret = btrfs_check_repairable(inode, failed_bio, failrec, failed_mirror);
        if (!ret) {
                free_io_failure(inode, failrec);
-               return -EIO;
+               return -EIEIO;
        }
 
        if (failed_bio->bi_vcnt > 1)
@@ -2434,7 +2434,7 @@ static int bio_readpage_error(struct bio *failed_bio, u64 phy_offset,
                                      NULL);
        if (!bio) {
                free_io_failure(inode, failrec);
-               return -EIO;
+               return -EIEIO;
        }
 
        pr_debug("Repair Read Error: submitting new read[%#x] to this_mirror=%d, in_validation=%d\n",
@@ -2471,7 +2471,7 @@ int end_extent_writepage(struct page *page, int err, u64 start, u64 end)
        if (!uptodate) {
                ClearPageUptodate(page);
                SetPageError(page);
-               ret = ret < 0 ? ret : -EIO;
+               ret = ret < 0 ? ret : -EIEIO;
                mapping_set_error(page->mapping, ret);
        }
        return 0;
@@ -2625,7 +2625,7 @@ static void end_bio_extent_readpage(struct bio *bio, int err)
                         * end_bio_extent_readpage as well (if we're lucky, not
                         * in the !uptodate case). In that case it returns 0 and
                         * we just go on with the next page in our bio. If it
-                        * can't handle the error it will return -EIO and we
+                        * can't handle the error it will return -EIEIO and we
                         * remain responsible for that page.
                         */
                        ret = bio_readpage_error(bio, offset, page, start, end,
@@ -3265,7 +3265,7 @@ static noinline_for_stack int writepage_delalloc(struct inode *inode,
                         * IO is started, so we don't want to return > 0
                         * unless things are going well.
                         */
-                       ret = ret < 0 ? ret : -EIO;
+                       ret = ret < 0 ? ret : -EIEIO;
                        goto done;
                }
                /*
@@ -3542,7 +3542,7 @@ done:
                end_page_writeback(page);
        }
        if (PageError(page)) {
-               ret = ret < 0 ? ret : -EIO;
+               ret = ret < 0 ? ret : -EIEIO;
                end_extent_writepage(page, ret, start, page_end);
        }
        unlock_page(page);
@@ -3761,7 +3761,7 @@ static noinline_for_stack int write_one_eb(struct extent_buffer *eb,
                        end_page_writeback(p);
                        if (atomic_sub_and_test(num_pages - i, &eb->io_pages))
                                end_extent_buffer_writeback(eb);
-                       ret = -EIO;
+                       ret = -EIEIO;
                        break;
                }
                offset += PAGE_CACHE_SIZE;
@@ -5224,7 +5224,7 @@ int read_extent_buffer_pages(struct extent_io_tree *tree,
                page = eb->pages[i];
                wait_on_page_locked(page);
                if (!PageUptodate(page))
-                       ret = -EIO;
+                       ret = -EIEIO;
        }
 
        return ret;
index c668f36898d3a4c2dd2e0e18456dd2cfa6c55747..c3a35637fe694bdd6cd41d029ef6697f49c8317f 100644 (file)
@@ -343,7 +343,7 @@ int repair_eb_io_failure(struct btrfs_root *root, struct extent_buffer *eb,
                         int mirror_num);
 
 /*
- * When IO fails, either with EIO or csum verification fails, we
+ * When IO fails, either with EIEIO or csum verification fails, we
  * try other mirrors that might have a good copy of the data.  This
  * io_failure_record is used to record state as we go through all the
  * mirrors.  If another mirror has good data, the page is set up to date
index b072e17479aa8e26a32ede03fa8b5315ca1f9a7e..73ab38417663e2cff09b3111da0118fe96eb0765 100644 (file)
@@ -1296,7 +1296,7 @@ static int prepare_uptodate_page(struct page *page, u64 pos,
                lock_page(page);
                if (!PageUptodate(page)) {
                        unlock_page(page);
-                       return -EIO;
+                       return -EIEIO;
                }
        }
        return 0;
@@ -2034,7 +2034,7 @@ int btrfs_sync_file(struct file *file, loff_t start, loff_t end, int datasync)
         * successful. And we also want to make sure our log doesn't contain
         * file extent items pointing to extents that weren't fully written to -
         * just like in the non fast fsync path, where we check for the ordered
-        * operation's error flag before writing to the log tree and return -EIO
+        * operation's error flag before writing to the log tree and return -EIEIO
         * if any of them had this flag set (btrfs_wait_ordered_range) -
         * therefore we need to check for errors in the ordered operations,
         * which are indicated by ctx.io_err.
@@ -2066,7 +2066,7 @@ int btrfs_sync_file(struct file *file, loff_t start, loff_t end, int datasync)
                ret = btrfs_end_transaction(trans, root);
        }
 out:
-       return ret > 0 ? -EIO : ret;
+       return ret > 0 ? -EIEIO : ret;
 }
 
 static const struct vm_operations_struct btrfs_file_vm_ops = {
index 9dbe5b548fa6a74029960de0ea1d8ebf63f835e8..fbdb34df381eb0dcd9a7c4158bd1ae1e83f4873b 100644 (file)
@@ -397,7 +397,7 @@ static int io_ctl_prepare_pages(struct btrfs_io_ctl *io_ctl, struct inode *inode
                                btrfs_err(BTRFS_I(inode)->root->fs_info,
                                           "error reading free space cache");
                                io_ctl_drop_pages(io_ctl);
-                               return -EIO;
+                               return -EIEIO;
                        }
                }
        }
@@ -456,7 +456,7 @@ static int io_ctl_check_generation(struct btrfs_io_ctl *io_ctl, u64 generation)
                                   "(%Lu) does not match inode (%Lu)\n", *gen,
                                   generation);
                io_ctl_unmap_page(io_ctl);
-               return -EIO;
+               return -EIEIO;
        }
        io_ctl->cur += sizeof(u64);
        return 0;
@@ -511,7 +511,7 @@ static int io_ctl_check_crc(struct btrfs_io_ctl *io_ctl, int index)
                printk_ratelimited(KERN_ERR "BTRFS: csum mismatch on free "
                                   "space cache\n");
                io_ctl_unmap_page(io_ctl);
-               return -EIO;
+               return -EIEIO;
        }
 
        return 0;
@@ -1235,7 +1235,7 @@ static int __btrfs_write_out_cache(struct btrfs_root *root, struct inode *inode,
        int must_iput = 0;
 
        if (!i_size_read(inode))
-               return -EIO;
+               return -EIEIO;
 
        WARN_ON(io_ctl->pages);
        ret = io_ctl_init(io_ctl, inode, root, 1);
index 8474b8b617d1aa77f44e6cace90b343ebb7bdd4f..cf83c01e4abf76c0f93641da26a42ff2ea04480e 100644 (file)
@@ -2802,7 +2802,7 @@ static int btrfs_finish_ordered_io(struct btrfs_ordered_extent *ordered_extent)
        nolock = btrfs_is_free_space_inode(inode);
 
        if (test_bit(BTRFS_ORDERED_IOERR, &ordered_extent->flags)) {
-               ret = -EIO;
+               ret = -EIEIO;
                goto out;
        }
 
@@ -3037,7 +3037,7 @@ zeroit:
        kunmap_atomic(kaddr);
        if (csum_expected == 0)
                return 0;
-       return -EIO;
+       return -EIEIO;
 }
 
 /*
@@ -4566,7 +4566,7 @@ again:
                        goto again;
                }
                if (!PageUptodate(page)) {
-                       ret = -EIO;
+                       ret = -EIEIO;
                        goto out_unlock;
                }
        }
@@ -6830,7 +6830,7 @@ insert:
        if (em->start > start || extent_map_end(em) <= start) {
                btrfs_err(root->fs_info, "bad extent! em: [%llu %llu] passed [%llu %llu]",
                        em->start, em->len, start, len);
-               err = -EIO;
+               err = -EIEIO;
                goto out;
        }
 
@@ -7648,7 +7648,7 @@ static int dio_read_error(struct inode *inode, struct bio *failed_bio,
                                         failed_mirror);
        if (!ret) {
                free_io_failure(inode, failrec);
-               return -EIO;
+               return -EIEIO;
        }
 
        if (failed_bio->bi_vcnt > 1)
@@ -7662,7 +7662,7 @@ static int dio_read_error(struct inode *inode, struct bio *failed_bio,
                                      0, isector, repair_endio, repair_arg);
        if (!bio) {
                free_io_failure(inode, failrec);
-               return -EIO;
+               return -EIEIO;
        }
 
        btrfs_debug(BTRFS_I(inode)->root->fs_info,
@@ -8066,7 +8066,7 @@ static int btrfs_submit_direct_hook(int rw, struct btrfs_dio_private *dip,
        ret = btrfs_map_block(root->fs_info, rw, start_sector << 9,
                              &map_length, NULL, 0);
        if (ret)
-               return -EIO;
+               return -EIEIO;
 
        if (map_length >= orig_bio->bi_iter.bi_size) {
                bio = orig_bio;
@@ -8549,7 +8549,7 @@ int btrfs_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf)
        if (ret) {
                if (ret == -ENOMEM)
                        ret = VM_FAULT_OOM;
-               else /* -ENOSPC, -EIO, etc */
+               else /* -ENOSPC, -EIEIO, etc */
                        ret = VM_FAULT_SIGBUS;
                if (reserved)
                        goto out;
@@ -9786,7 +9786,7 @@ int btrfs_inode_check_errors(struct inode *inode)
                ret = -ENOSPC;
        if (test_bit(AS_EIO, &inode->i_mapping->flags) &&
            test_and_clear_bit(AS_EIO, &inode->i_mapping->flags))
-               ret = -EIO;
+               ret = -EIEIO;
 
        return ret;
 }
index 16cd61afa9b416b8bf955e364ae7b51923e549f1..481a382c6a4e25451749f24baa2b8f2bed5c62e8 100644 (file)
@@ -1164,7 +1164,7 @@ again:
                        if (!PageUptodate(page)) {
                                unlock_page(page);
                                page_cache_release(page);
-                               ret = -EIO;
+                               ret = -EIEIO;
                                break;
                        }
                }
index a2f0513477313fb6edbc4f898df70262eda96aef..5bea1f9260f231f919b01e6ef3a3a1834fb3e0c8 100644 (file)
@@ -143,7 +143,7 @@ static int lzo_compress_pages(struct list_head *ws,
                if (ret != LZO_E_OK) {
                        printk(KERN_DEBUG "BTRFS: deflate in loop returned %d\n",
                               ret);
-                       ret = -EIO;
+                       ret = -EIEIO;
                        goto out;
                }
 
@@ -334,7 +334,7 @@ cont:
                                        break;
 
                                if (page_in_index + 1 >= total_pages_in) {
-                                       ret = -EIO;
+                                       ret = -EIEIO;
                                        goto done;
                                }
 
@@ -357,7 +357,7 @@ cont:
                        kunmap(pages_in[page_in_index - 1]);
                if (ret != LZO_E_OK) {
                        printk(KERN_WARNING "BTRFS: decompress failed\n");
-                       ret = -EIO;
+                       ret = -EIEIO;
                        break;
                }
 
@@ -403,12 +403,12 @@ static int lzo_decompress(struct list_head *ws, unsigned char *data_in,
        ret = lzo1x_decompress_safe(data_in, in_len, workspace->buf, &out_len);
        if (ret != LZO_E_OK) {
                printk(KERN_WARNING "BTRFS: decompress failed!\n");
-               ret = -EIO;
+               ret = -EIEIO;
                goto out;
        }
 
        if (out_len < start_byte) {
-               ret = -EIO;
+               ret = -EIEIO;
                goto out;
        }
 
index 760c4a5e096b4d5a403f7923ad4b65537a085886..250dc7a67a84e6ef57c0948c1850168a3ebf6fb1 100644 (file)
@@ -767,7 +767,7 @@ int btrfs_wait_ordered_range(struct inode *inode, u64 start, u64 len)
                btrfs_start_ordered_extent(inode, ordered, 1);
                end = ordered->file_offset;
                if (test_bit(BTRFS_ORDERED_IOERR, &ordered->flags))
-                       ret = -EIO;
+                       ret = -EIEIO;
                btrfs_put_ordered_extent(ordered);
                if (ret || end == 0 || end == start)
                        break;
index fa72068bd256018e27a13fbc8326b82ce49b207b..17549639338f08f8c5ff9dc970a5eb6f8162c7f3 100644 (file)
@@ -891,7 +891,7 @@ static void raid_write_end_io(struct bio *bio, int err)
 
        /* OK, we have read all the stripes we need to. */
        if (atomic_read(&rbio->error) > rbio->bbio->max_errors)
-               err = -EIO;
+               err = -EIEIO;
 
        rbio_orig_end_io(rbio, err, 0);
        return;
@@ -1318,7 +1318,7 @@ write_data:
        return;
 
 cleanup:
-       rbio_orig_end_io(rbio, -EIO, 0);
+       rbio_orig_end_io(rbio, -EIEIO, 0);
 }
 
 /*
@@ -1373,7 +1373,7 @@ static int find_logical_bio_stripe(struct btrfs_raid_bio *rbio,
 }
 
 /*
- * returns -EIO if we had too many failures
+ * returns -EIEIO if we had too many failures
  */
 static int fail_rbio_index(struct btrfs_raid_bio *rbio, int failed)
 {
@@ -1395,7 +1395,7 @@ static int fail_rbio_index(struct btrfs_raid_bio *rbio, int failed)
                rbio->failb = failed;
                atomic_inc(&rbio->error);
        } else {
-               ret = -EIO;
+               ret = -EIEIO;
        }
 out:
        spin_unlock_irqrestore(&rbio->bio_list_lock, flags);
@@ -1413,7 +1413,7 @@ static int fail_bio_stripe(struct btrfs_raid_bio *rbio,
        int failed = find_bio_stripe(rbio, bio);
 
        if (failed < 0)
-               return -EIO;
+               return -EIEIO;
 
        return fail_rbio_index(rbio, failed);
 }
@@ -1469,7 +1469,7 @@ static void raid_rmw_end_io(struct bio *bio, int err)
 
 cleanup:
 
-       rbio_orig_end_io(rbio, -EIO, 0);
+       rbio_orig_end_io(rbio, -EIEIO, 0);
 }
 
 static void async_rmw_stripe(struct btrfs_raid_bio *rbio)
@@ -1579,8 +1579,8 @@ static int raid56_rmw_stripe(struct btrfs_raid_bio *rbio)
        return 0;
 
 cleanup:
-       rbio_orig_end_io(rbio, -EIO, 0);
-       return -EIO;
+       rbio_orig_end_io(rbio, -EIEIO, 0);
+       return -EIEIO;
 
 finish:
        validate_rbio_for_rmw(rbio);
@@ -1856,7 +1856,7 @@ static void __raid_recover_end_io(struct btrfs_raid_bio *rbio)
                                         * a bad data or Q stripe.
                                         * TODO, we should redo the xor here.
                                         */
-                                       err = -EIO;
+                                       err = -EIEIO;
                                        goto cleanup;
                                }
                                /*
@@ -1882,7 +1882,7 @@ static void __raid_recover_end_io(struct btrfs_raid_bio *rbio)
                        if (rbio->bbio->raid_map[failb] == RAID6_Q_STRIPE) {
                                if (rbio->bbio->raid_map[faila] ==
                                    RAID5_P_STRIPE) {
-                                       err = -EIO;
+                                       err = -EIEIO;
                                        goto cleanup;
                                }
                                /*
@@ -2002,7 +2002,7 @@ static void raid_recover_end_io(struct bio *bio, int err)
                return;
 
        if (atomic_read(&rbio->error) > rbio->bbio->max_errors)
-               rbio_orig_end_io(rbio, -EIO, 0);
+               rbio_orig_end_io(rbio, -EIEIO, 0);
        else
                __raid_recover_end_io(rbio);
 }
@@ -2102,8 +2102,8 @@ out:
 
 cleanup:
        if (rbio->operation == BTRFS_RBIO_READ_REBUILD)
-               rbio_orig_end_io(rbio, -EIO, 0);
-       return -EIO;
+               rbio_orig_end_io(rbio, -EIEIO, 0);
+       return -EIEIO;
 }
 
 /*
@@ -2136,7 +2136,7 @@ int raid56_parity_recover(struct btrfs_root *root, struct bio *bio,
                if (generic_io)
                        btrfs_put_bbio(bbio);
                kfree(rbio);
-               return -EIO;
+               return -EIEIO;
        }
 
        if (generic_io) {
@@ -2292,7 +2292,7 @@ static void raid_write_parity_end_io(struct bio *bio, int err)
        err = 0;
 
        if (atomic_read(&rbio->error))
-               err = -EIO;
+               err = -EIEIO;
 
        rbio_orig_end_io(rbio, err, 0);
 }
@@ -2456,7 +2456,7 @@ submit_write:
        return;
 
 cleanup:
-       rbio_orig_end_io(rbio, -EIO, 0);
+       rbio_orig_end_io(rbio, -EIEIO, 0);
 }
 
 static inline int is_data_stripe(struct btrfs_raid_bio *rbio, int stripe)
@@ -2524,7 +2524,7 @@ static void validate_rbio_for_parity_scrub(struct btrfs_raid_bio *rbio)
        return;
 
 cleanup:
-       rbio_orig_end_io(rbio, -EIO, 0);
+       rbio_orig_end_io(rbio, -EIEIO, 0);
 }
 
 /*
@@ -2639,7 +2639,7 @@ static void raid56_parity_scrub_stripe(struct btrfs_raid_bio *rbio)
        return;
 
 cleanup:
-       rbio_orig_end_io(rbio, -EIO, 0);
+       rbio_orig_end_io(rbio, -EIEIO, 0);
        return;
 
 finish:
index 74b24b01d5740041a69aab1d083391c2e03ade8b..bc41ff8c83127c5f013a0d5d3e6b7c148e39d530 100644 (file)
@@ -1848,7 +1848,7 @@ again:
 
                        eb = read_tree_block(dest, old_bytenr, old_ptr_gen);
                        if (!eb || !extent_buffer_uptodate(eb)) {
-                               ret = (!eb) ? -ENOMEM : -EIO;
+                               ret = (!eb) ? -ENOMEM : -EIEIO;
                                free_extent_buffer(eb);
                                break;
                        }
@@ -2004,7 +2004,7 @@ int walk_down_reloc_tree(struct btrfs_root *root, struct btrfs_path *path,
                eb = read_tree_block(root, bytenr, ptr_gen);
                if (!eb || !extent_buffer_uptodate(eb)) {
                        free_extent_buffer(eb);
-                       return -EIO;
+                       return -EIEIO;
                }
                BUG_ON(btrfs_header_level(eb) != i - 1);
                path->nodes[i - 1] = eb;
@@ -2712,7 +2712,7 @@ static int do_relocation(struct btrfs_trans_handle *trans,
                eb = read_tree_block(root, bytenr, generation);
                if (!eb || !extent_buffer_uptodate(eb)) {
                        free_extent_buffer(eb);
-                       err = -EIO;
+                       err = -EIEIO;
                        goto next;
                }
                btrfs_tree_lock(eb);
@@ -2875,7 +2875,7 @@ static int get_tree_block_key(struct reloc_control *rc,
                             block->key.offset);
        if (!eb || !extent_buffer_uptodate(eb)) {
                free_extent_buffer(eb);
-               return -EIO;
+               return -EIEIO;
        }
        WARN_ON(btrfs_header_level(eb) != block->level);
        if (block->level == 0)
@@ -3158,7 +3158,7 @@ static int relocate_file_extent_cluster(struct inode *inode,
                                page_cache_release(page);
                                btrfs_delalloc_release_metadata(inode,
                                                        PAGE_CACHE_SIZE);
-                               ret = -EIO;
+                               ret = -EIEIO;
                                goto out;
                        }
                }
index ab5811545a988edf685ef4acce607cbff1ac7b81..851b0d8e24c681a661dbe16bd93a41c3f8ee4bc6 100644 (file)
@@ -737,7 +737,7 @@ static int scrub_fixup_readpage(u64 inum, u64 offset, u64 root, void *fixup_ctx)
                         * later scrub will find the bad sector again and that
                         * there's no dirty page in memory, then.
                         */
-                       ret = -EIO;
+                       ret = -EIEIO;
                        goto out;
                }
                ret = repair_io_failure(inode, offset, PAGE_SIZE,
@@ -791,7 +791,7 @@ out:
                return 1;
        }
 
-       return -EIO;
+       return -EIEIO;
 }
 
 static void scrub_fixup_nodatasum(struct btrfs_work *work)
@@ -879,7 +879,7 @@ static inline void scrub_put_recover(struct scrub_recover *recover)
 
 /*
  * scrub_handle_errored_block gets called when either verification of the
- * pages failed or the bio failed to read, e.g. with EIO. In the latter
+ * pages failed or the bio failed to read, e.g. with EIEIO. In the latter
  * case, this function handles all pages in the bio, even though only one
  * may be bad.
  * The goal of this function is to repair the errored block by using the
@@ -1351,7 +1351,7 @@ static int scrub_setup_recheck_block(struct scrub_block *original_sblock,
                                       &mapped_length, &bbio, 0, 1);
                if (ret || !bbio || mapped_length < sublen) {
                        btrfs_put_bbio(bbio);
-                       return -EIO;
+                       return -EIEIO;
                }
 
                recover = kzalloc(sizeof(struct scrub_recover), GFP_NOFS);
@@ -1464,7 +1464,7 @@ static int scrub_submit_raid56_bio_wait(struct btrfs_fs_info *fs_info,
 
        wait_for_completion(&done.event);
        if (done.error)
-               return -EIO;
+               return -EIEIO;
 
        return 0;
 }
@@ -1632,19 +1632,19 @@ static int scrub_repair_page_from_good_copy(struct scrub_block *sblock_bad,
                        printk_ratelimited(KERN_WARNING "BTRFS: "
                                "scrub_repair_page_from_good_copy(bdev == NULL) "
                                "is unexpected!\n");
-                       return -EIO;
+                       return -EIEIO;
                }
 
                bio = btrfs_io_bio_alloc(GFP_NOFS, 1);
                if (!bio)
-                       return -EIO;
+                       return -EIEIO;
                bio->bi_bdev = page_bad->dev->bdev;
                bio->bi_iter.bi_sector = page_bad->physical >> 9;
 
                ret = bio_add_page(bio, page_good->page, PAGE_SIZE, 0);
                if (PAGE_SIZE != ret) {
                        bio_put(bio);
-                       return -EIO;
+                       return -EIEIO;
                }
 
                if (btrfsic_submit_bio_wait(WRITE, bio)) {
@@ -1654,7 +1654,7 @@ static int scrub_repair_page_from_good_copy(struct scrub_block *sblock_bad,
                                &sblock_bad->sctx->dev_root->fs_info->
                                dev_replace.num_write_errors);
                        bio_put(bio);
-                       return -EIO;
+                       return -EIEIO;
                }
                bio_put(bio);
        }
@@ -1755,7 +1755,7 @@ again:
                        bio_put(sbio->bio);
                        sbio->bio = NULL;
                        mutex_unlock(&wr_ctx->wr_lock);
-                       return -EIO;
+                       return -EIEIO;
                }
                scrub_wr_submit(sctx);
                goto again;
@@ -2098,7 +2098,7 @@ static void scrub_submit(struct scrub_ctx *sctx)
                 */
                printk_ratelimited(KERN_WARNING
                        "BTRFS: scrub_submit(bio bdev == NULL) is unexpected!\n");
-               bio_endio(sbio->bio, -EIO);
+               bio_endio(sbio->bio, -EIEIO);
        } else {
                btrfsic_submit_bio(READ, sbio->bio);
        }
@@ -2163,7 +2163,7 @@ again:
                if (sbio->page_count < 1) {
                        bio_put(sbio->bio);
                        sbio->bio = NULL;
-                       return -EIO;
+                       return -EIEIO;
                }
                scrub_submit(sctx);
                goto again;
@@ -3494,7 +3494,7 @@ int scrub_enumerate_chunks(struct scrub_ctx *sctx,
                        break;
                if (is_dev_replace &&
                    atomic64_read(&dev_replace->num_write_errors) > 0) {
-                       ret = -EIO;
+                       ret = -EIEIO;
                        break;
                }
                if (sctx->stat.malloc_errors > 0) {
@@ -3528,7 +3528,7 @@ static noinline_for_stack int scrub_supers(struct scrub_ctx *sctx,
        struct btrfs_root *root = sctx->dev_root;
 
        if (test_bit(BTRFS_FS_STATE_ERROR, &root->fs_info->fs_state))
-               return -EIO;
+               return -EIEIO;
 
        /* Seed devices of a new filesystem has their own generation. */
        if (scrub_dev->fs_devices != root->fs_info->fs_devices)
@@ -3677,7 +3677,7 @@ int btrfs_scrub_dev(struct btrfs_fs_info *fs_info, u64 devid, u64 start,
        if (!dev->in_fs_metadata || dev->is_tgtdev_for_dev_replace) {
                mutex_unlock(&fs_info->scrub_lock);
                mutex_unlock(&fs_info->fs_devices->device_list_mutex);
-               return -EIO;
+               return -EIEIO;
        }
 
        btrfs_dev_replace_lock(&fs_info->dev_replace);
@@ -4152,7 +4152,7 @@ again:
                                goto again;
                        }
                        if (!PageUptodate(page)) {
-                               ret = -EIO;
+                               ret = -EIEIO;
                                goto next_page;
                        }
                }
@@ -4196,11 +4196,11 @@ static int write_page_nocow(struct scrub_ctx *sctx,
 
        dev = sctx->wr_ctx.tgtdev;
        if (!dev)
-               return -EIO;
+               return -EIEIO;
        if (!dev->bdev) {
                printk_ratelimited(KERN_WARNING
                        "BTRFS: scrub write_page_nocow(bdev == NULL) is unexpected!\n");
-               return -EIO;
+               return -EIEIO;
        }
        bio = btrfs_io_bio_alloc(GFP_NOFS, 1);
        if (!bio) {
@@ -4217,7 +4217,7 @@ static int write_page_nocow(struct scrub_ctx *sctx,
 leave_with_eio:
                bio_put(bio);
                btrfs_dev_stat_inc_and_print(dev, BTRFS_DEV_STAT_WRITE_ERRS);
-               return -EIO;
+               return -EIEIO;
        }
 
        if (btrfsic_submit_bio_wait(WRITE_SYNC, bio))
index a1216f9b49171510194109c7594c61b4277298ea..4572fa78b65ebea8514236aaa8d28403e2bff701 100644 (file)
@@ -525,7 +525,7 @@ static int write_buf(struct file *filp, const void *buf, u32 len, loff_t *off)
                if (ret < 0)
                        goto out;
                if (ret == 0) {
-                       ret = -EIO;
+                       ret = -EIEIO;
                        goto out;
                }
                pos += ret;
@@ -1343,7 +1343,7 @@ static int find_extent_clone(struct send_ctx *sctx,
        if (ret < 0)
                goto out;
        if (flags & BTRFS_EXTENT_FLAG_TREE_BLOCK) {
-               ret = -EIO;
+               ret = -EIEIO;
                goto out;
        }
 
@@ -1388,7 +1388,7 @@ static int find_extent_clone(struct send_ctx *sctx,
 
        if (!backref_ctx->found_itself) {
                /* found a bug in backref code? */
-               ret = -EIO;
+               ret = -EIEIO;
                btrfs_err(sctx->send_root->fs_info, "did not find backref in "
                                "send_root. inode=%llu, offset=%llu, "
                                "disk_byte=%llu found extent=%llu",
@@ -4399,7 +4399,7 @@ static ssize_t fill_read_buf(struct send_ctx *sctx, u64 offset, u32 len)
                        if (!PageUptodate(page)) {
                                unlock_page(page);
                                page_cache_release(page);
-                               ret = -EIO;
+                               ret = -EIEIO;
                                break;
                        }
                }
index 6d1937230e8fea10d2044489eebd17db4294cacf..809221b0fdd86be4f959cf98df193c5a5ffaab72 100644 (file)
@@ -242,7 +242,7 @@ void __btrfs_std_error(struct btrfs_fs_info *fs_info, const char *function,
  * This means that error recovery at the call site is limited to freeing
  * any local memory allocations and passing the error code up without
  * further cleanup. The transaction should complete as it normally would
- * in the call path but will return -EIO.
+ * in the call path but will return -EIEIO.
  *
  * We'll complete the cleanup in btrfs_end_transaction and
  * btrfs_commit_transaction.
index 94e909c5a50342995ea960e38c1380f9d2132125..8159ff6f844a08023a09e264080372171e6b421f 100644 (file)
@@ -830,7 +830,7 @@ static int __btrfs_end_transaction(struct btrfs_trans_handle *trans,
        if (trans->aborted ||
            test_bit(BTRFS_FS_STATE_ERROR, &root->fs_info->fs_state)) {
                wake_up_process(info->transaction_kthread);
-               err = -EIO;
+               err = -EIEIO;
        }
        assert_qgroups_uptodate(trans);
 
@@ -969,7 +969,7 @@ int btrfs_wait_marked_extents(struct btrfs_root *root,
        }
 
        if (errors && !werr)
-               werr = -EIO;
+               werr = -EIEIO;
 
        return werr;
 }
index fcf237640a98ea28e54a96f3d6caeb2ad29ff143..5591ee43551a19f44952077673bad7107b48edbb 100644 (file)
@@ -621,7 +621,7 @@ static noinline int replay_one_extent(struct btrfs_trans_handle *trans,
 
        inode = read_one_inode(root, key->objectid);
        if (!inode) {
-               ret = -EIO;
+               ret = -EIEIO;
                goto out;
        }
 
@@ -797,7 +797,7 @@ static noinline int drop_one_dir_item(struct btrfs_trans_handle *trans,
 
        inode = read_one_inode(root, location.objectid);
        if (!inode) {
-               ret = -EIO;
+               ret = -EIEIO;
                goto out;
        }
 
@@ -1197,7 +1197,7 @@ static noinline int add_inode_ref(struct btrfs_trans_handle *trans,
 
        inode = read_one_inode(root, inode_objectid);
        if (!inode) {
-               ret = -EIO;
+               ret = -EIEIO;
                goto out;
        }
 
@@ -1480,7 +1480,7 @@ static noinline int fixup_inode_link_counts(struct btrfs_trans_handle *trans,
                btrfs_release_path(path);
                inode = read_one_inode(root, key.offset);
                if (!inode)
-                       return -EIO;
+                       return -EIEIO;
 
                ret = fixup_inode_link_count(trans, root, inode);
                iput(inode);
@@ -1517,7 +1517,7 @@ static noinline int link_to_fixup_dir(struct btrfs_trans_handle *trans,
 
        inode = read_one_inode(root, objectid);
        if (!inode)
-               return -EIO;
+               return -EIEIO;
 
        key.objectid = BTRFS_TREE_LOG_FIXUP_OBJECTID;
        key.type = BTRFS_ORPHAN_ITEM_KEY;
@@ -1565,7 +1565,7 @@ static noinline int insert_one_name(struct btrfs_trans_handle *trans,
        dir = read_one_inode(root, dirid);
        if (!dir) {
                iput(inode);
-               return -EIO;
+               return -EIEIO;
        }
 
        ret = btrfs_add_link(trans, dir, inode, name, name_len, 1, index);
@@ -1634,7 +1634,7 @@ static noinline int replay_one_name(struct btrfs_trans_handle *trans,
 
        dir = read_one_inode(root, key->objectid);
        if (!dir)
-               return -EIO;
+               return -EIEIO;
 
        name_len = btrfs_dir_name_len(eb, di);
        name = kmalloc(name_len, GFP_NOFS);
@@ -1752,7 +1752,7 @@ static noinline int replay_one_dir_item(struct btrfs_trans_handle *trans,
        while (ptr < ptr_end) {
                di = (struct btrfs_dir_item *)ptr;
                if (verify_dir_item(root, eb, di))
-                       return -EIO;
+                       return -EIEIO;
                name_len = btrfs_dir_name_len(eb, di);
                ret = replay_one_name(trans, root, path, eb, di, key);
                if (ret)
@@ -1881,7 +1881,7 @@ again:
        while (ptr < ptr_end) {
                di = (struct btrfs_dir_item *)ptr;
                if (verify_dir_item(root, eb, di)) {
-                       ret = -EIO;
+                       ret = -EIEIO;
                        goto out;
                }
 
@@ -1912,7 +1912,7 @@ again:
                        inode = read_one_inode(root, location.objectid);
                        if (!inode) {
                                kfree(name);
-                               return -EIO;
+                               return -EIEIO;
                        }
 
                        ret = link_to_fixup_dir(trans, root,
@@ -3950,7 +3950,7 @@ static int log_one_extent(struct btrfs_trans_handle *trans,
                return ret;
 
        if (ordered_io_err) {
-               ctx->io_err = -EIO;
+               ctx->io_err = -EIEIO;
                return 0;
        }
 
index 174f5e1e00abfa533b1cb7483e44aae0f550e63a..7f04303d2462bddb11b1e7ab75ac91387de894b2 100644 (file)
@@ -2560,7 +2560,7 @@ static int btrfs_del_sys_chunk(struct btrfs_root *root, u64 chunk_objectid, u64
                        num_stripes = btrfs_stack_chunk_num_stripes(chunk);
                        len += btrfs_chunk_item_size(num_stripes);
                } else {
-                       ret = -EIO;
+                       ret = -EIEIO;
                        break;
                }
                if (key.objectid == chunk_objectid &&
@@ -5063,7 +5063,7 @@ static int __btrfs_map_block(struct btrfs_fs_info *fs_info, int rw,
                 * the last one to the array of stripes. For READ, it also
                 * needs to be supported using the same mirror number.
                 * If the requested block is not left of the left cursor,
-                * EIO is returned. This can happen because btrfs_num_copies()
+                * EIEIO is returned. This can happen because btrfs_num_copies()
                 * returns one more in the dev-replace case.
                 */
                u64 tmp_length = *length;
@@ -5088,7 +5088,7 @@ static int __btrfs_map_block(struct btrfs_fs_info *fs_info, int rw,
                         * mirror, that means that the requested area
                         * is not left of the left cursor
                         */
-                       ret = -EIO;
+                       ret = -EIEIO;
                        btrfs_put_bbio(tmp_bbio);
                        goto out;
                }
@@ -5123,7 +5123,7 @@ static int __btrfs_map_block(struct btrfs_fs_info *fs_info, int rw,
                        physical_to_patch_in_first_stripe = physical_of_found;
                } else {
                        WARN_ON(1);
-                       ret = -EIO;
+                       ret = -EIEIO;
                        btrfs_put_bbio(tmp_bbio);
                        goto out;
                }
@@ -5519,14 +5519,14 @@ int btrfs_rmap_block(struct btrfs_mapping_tree *map_tree,
        if (!em) {
                printk(KERN_ERR "BTRFS: couldn't find em for chunk %Lu\n",
                       chunk_start);
-               return -EIO;
+               return -EIEIO;
        }
 
        if (em->start != chunk_start) {
                printk(KERN_ERR "BTRFS: bad chunk start, em=%Lu, wanted=%Lu\n",
                       em->start, chunk_start);
                free_extent_map(em);
-               return -EIO;
+               return -EIEIO;
        }
        map = (struct map_lookup *)em->bdev;
 
@@ -5601,7 +5601,7 @@ static void btrfs_end_bio(struct bio *bio, int err)
 
        if (err) {
                atomic_inc(&bbio->error);
-               if (err == -EIO || err == -EREMOTEIO) {
+               if (err == -EIEIO || err == -EREMOTEIO) {
                        unsigned int stripe_index =
                                btrfs_io_bio(bio)->stripe_index;
 
@@ -5640,7 +5640,7 @@ static void btrfs_end_bio(struct bio *bio, int err)
                 * beyond the tolerance of the btrfs bio
                 */
                if (atomic_read(&bbio->error) > bbio->max_errors) {
-                       err = -EIO;
+                       err = -EIEIO;
                } else {
                        /*
                         * this bio is actually up to date, we didn't
@@ -5671,7 +5671,7 @@ static noinline void btrfs_schedule_bio(struct btrfs_root *root,
        struct btrfs_pending_bios *pending_bios;
 
        if (device->missing || !device->bdev) {
-               bio_endio(bio, -EIO);
+               bio_endio(bio, -EIEIO);
                return;
        }
 
@@ -5821,7 +5821,7 @@ static void bbio_error(struct btrfs_bio *bbio, struct bio *bio, u64 logical)
                btrfs_io_bio(bio)->mirror_num = bbio->mirror_num;
                bio->bi_iter.bi_sector = logical >> 9;
 
-               btrfs_end_bbio(bbio, bio, -EIO);
+               btrfs_end_bbio(bbio, bio, -EIEIO);
        }
 }
 
@@ -6068,7 +6068,7 @@ static int read_one_chunk(struct btrfs_root *root, struct btrfs_key *key,
                                                        uuid, NULL);
                if (!map->stripes[i].dev && !btrfs_test_opt(root, DEGRADED)) {
                        free_extent_map(em);
-                       return -EIO;
+                       return -EIEIO;
                }
                if (!map->stripes[i].dev) {
                        map->stripes[i].dev =
@@ -6076,7 +6076,7 @@ static int read_one_chunk(struct btrfs_root *root, struct btrfs_key *key,
                                                devid, uuid);
                        if (!map->stripes[i].dev) {
                                free_extent_map(em);
-                               return -EIO;
+                               return -EIEIO;
                        }
                }
                map->stripes[i].dev->in_fs_metadata = 1;
@@ -6195,7 +6195,7 @@ static int read_one_dev(struct btrfs_root *root,
        device = btrfs_find_device(root->fs_info, devid, dev_uuid, fs_uuid);
        if (!device) {
                if (!btrfs_test_opt(root, DEGRADED))
-                       return -EIO;
+                       return -EIEIO;
 
                btrfs_warn(root->fs_info, "devid %llu missing", devid);
                device = add_missing_dev(root, fs_devices, devid, dev_uuid);
@@ -6203,7 +6203,7 @@ static int read_one_dev(struct btrfs_root *root,
                        return -ENOMEM;
        } else {
                if (!device->bdev && !btrfs_test_opt(root, DEGRADED))
-                       return -EIO;
+                       return -EIEIO;
 
                if(!device->bdev && !device->missing) {
                        /*
@@ -6330,7 +6330,7 @@ int btrfs_read_sys_array(struct btrfs_root *root)
                        if (ret)
                                break;
                } else {
-                       ret = -EIO;
+                       ret = -EIEIO;
                        break;
                }
                array_ptr += len;
@@ -6344,7 +6344,7 @@ out_short_read:
        printk(KERN_ERR "BTRFS: sys_array too short to read %u bytes at offset %u\n",
                        len, cur_offset);
        free_extent_buffer(sb);
-       return -EIO;
+       return -EIEIO;
 }
 
 int btrfs_read_chunk_tree(struct btrfs_root *root)
index 82990b8f872b6d455be25196ee88a97eb82bd932..31f71f859b9f0f1da467844f29b10d4fbbe1674b 100644 (file)
@@ -96,7 +96,7 @@ static int zlib_compress_pages(struct list_head *ws,
 
        if (Z_OK != zlib_deflateInit(&workspace->strm, 3)) {
                printk(KERN_WARNING "BTRFS: deflateInit failed\n");
-               ret = -EIO;
+               ret = -EIEIO;
                goto out;
        }
 
@@ -126,7 +126,7 @@ static int zlib_compress_pages(struct list_head *ws,
                        printk(KERN_DEBUG "BTRFS: deflate in loop returned %d\n",
                               ret);
                        zlib_deflateEnd(&workspace->strm);
-                       ret = -EIO;
+                       ret = -EIEIO;
                        goto out;
                }
 
@@ -186,7 +186,7 @@ static int zlib_compress_pages(struct list_head *ws,
        zlib_deflateEnd(&workspace->strm);
 
        if (ret != Z_STREAM_END) {
-               ret = -EIO;
+               ret = -EIEIO;
                goto out;
        }
 
@@ -250,7 +250,7 @@ static int zlib_decompress_biovec(struct list_head *ws, struct page **pages_in,
 
        if (Z_OK != zlib_inflateInit2(&workspace->strm, wbits)) {
                printk(KERN_WARNING "BTRFS: inflateInit failed\n");
-               return -EIO;
+               return -EIEIO;
        }
        while (workspace->strm.total_in < srclen) {
                ret = zlib_inflate(&workspace->strm, Z_NO_FLUSH);
@@ -292,7 +292,7 @@ static int zlib_decompress_biovec(struct list_head *ws, struct page **pages_in,
                }
        }
        if (ret != Z_STREAM_END)
-               ret = -EIO;
+               ret = -EIEIO;
        else
                ret = 0;
 done:
@@ -340,7 +340,7 @@ static int zlib_decompress(struct list_head *ws, unsigned char *data_in,
 
        if (Z_OK != zlib_inflateInit2(&workspace->strm, wbits)) {
                printk(KERN_WARNING "BTRFS: inflateInit failed\n");
-               return -EIO;
+               return -EIEIO;
        }
 
        while (bytes_left > 0) {
@@ -356,7 +356,7 @@ static int zlib_decompress(struct list_head *ws, unsigned char *data_in,
                total_out = workspace->strm.total_out;
 
                if (total_out == buf_start) {
-                       ret = -EIO;
+                       ret = -EIEIO;
                        break;
                }
 
@@ -384,7 +384,7 @@ next:
        }
 
        if (ret != Z_STREAM_END && bytes_left != 0)
-               ret = -EIO;
+               ret = -EIO; /* not EIEIO because it happens very often and is harmless */
        else
                ret = 0;