]> git.hungrycats.org Git - linux/commitdiff
zygo: trace where EIO comes from
authorZygo Blaxell <zblaxell@serenity.furryterror.org>
Sat, 18 Apr 2015 18:31:48 +0000 (14:31 -0400)
committerZygo Blaxell <zblaxell@serenity.furryterror.org>
Sat, 18 Apr 2015 18:31:48 +0000 (14:31 -0400)
28 files changed:
fs/btrfs/acl.c
fs/btrfs/backref.c
fs/btrfs/compression.c
fs/btrfs/compression.h
fs/btrfs/ctree.c
fs/btrfs/ctree.h
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/volumes.h
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 60cdd88eba932669e762c92cc07c8ae43ca5bf68..ef84c10e9539aa7a4e435b731ad5756e2d2d63e7 100644 (file)
@@ -493,7 +493,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)
@@ -1034,7 +1034,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);
@@ -1484,7 +1484,7 @@ int extent_from_logical(struct btrfs_fs_info *fs_info, u64 logical,
                return 0;
        }
 
-       return -EIO;
+       return -EIEIO;
 }
 
 /*
index a4bdb015ac11c62655e5826347109a71969e1dc6..22cb5d0374e17c197c5919144dba3d9b9be6f69d 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++;
@@ -590,7 +590,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 13a4dc0436c9d3072b401312b3d3bf82a789ae4e..9531b9ebddda4a255f88f6bdb46e0ee667b19f71 100644 (file)
@@ -80,4 +80,12 @@ struct btrfs_compress_op {
 extern const struct btrfs_compress_op btrfs_zlib_compress;
 extern const struct btrfs_compress_op btrfs_lzo_compress;
 
+#ifndef EIEIO
+static inline int eieio(const char *file, int line, const char *function) {
+       printk("EIO calculated at %s:%d in %s", file, line, function);
+       return EIO;
+}
+#define EIEIO (eieio(__FILE__, __LINE__, __FUNCTION__))
+#endif
+
 #endif
index b727e9b0d18f657db4a0f8e2b7237c078063d2e9..602c1eda6bda90e7ce294b91a3a1bbd6bd032295 100644 (file)
@@ -1689,7 +1689,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);
@@ -2477,7 +2477,7 @@ read_block_for_search(struct btrfs_trans_handle *trans,
                }
                free_extent_buffer(tmp);
                btrfs_release_path(p);
-               return -EIO;
+               return -EIEIO;
        }
 
        /*
@@ -2501,12 +2501,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 fc4f9b3a6088690586a284eec682f6a156399b15..13a24dce003784b81b29e77224a517da5a44ed5e 100644 (file)
@@ -4143,4 +4143,12 @@ static inline int btrfs_test_is_dummy_root(struct btrfs_root *root)
        return 0;
 }
 
+#ifndef EIEIO
+static inline int eieio(const char *file, int line, const char *function) {
+       printk("EIO calculated at %s:%d in %s", file, line, function);
+       return EIO;
+}
+#define EIEIO (eieio(__FILE__, __LINE__, __FUNCTION__))
+#endif
+
 #endif
index cde698a07d210f446ba4562c7a09647515610176..fdf32d91af91d74c53fb5553923d7fd6020b205b 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 3c421053559a2cbaeb8f4260287fefd77369e9fb..7f8b7a392538ca4239b8ab4c6868545e53570773 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 51abd27353340ae7d0b18162442de58f7216c831..01e218c61effbf2438d28da2cdd5865eb6ce242d 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, u32 blocksize,
 
        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 {
@@ -1514,7 +1514,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);
@@ -2306,7 +2306,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);
@@ -2324,7 +2324,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);
@@ -3298,7 +3298,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);
                }
@@ -3377,7 +3377,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;
 }
 
@@ -3526,9 +3526,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;
@@ -3544,9 +3544,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 787bfe611c55e4ccee92aa76bad2e226ac2742b9..b26706ab804c14d154ce65ed5b6a8e4694f34078 100644 (file)
@@ -1545,7 +1545,7 @@ again:
                err = -ENOENT;
                goto out;
        } else if (WARN_ON(ret)) {
-               err = -EIO;
+               err = -EIEIO;
                goto out;
        }
 
@@ -1916,7 +1916,7 @@ static 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,
@@ -2185,7 +2185,7 @@ again:
                                goto again;
                        }
                } else {
-                       err = -EIO;
+                       err = -EIEIO;
                        goto out;
                }
        }
@@ -2348,7 +2348,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,
@@ -6366,11 +6366,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;
 }
@@ -7693,7 +7693,7 @@ walk_down:
 
                        eb = read_tree_block(root, child_bytenr, child_gen);
                        if (!eb || !extent_buffer_uptodate(eb)) {
-                               ret = -EIO;
+                               ret = -EIEIO;
                                goto out;
                        }
 
@@ -7925,7 +7925,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);
@@ -9485,7 +9485,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 04cca7a1ed9d71519013893f134620200985b4a4..8e51384d088e57e6934e5c7ada2ce04ee1df1d1c 100644 (file)
@@ -2016,7 +2016,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;
 
@@ -2024,7 +2024,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;
@@ -2033,7 +2033,7 @@ int repair_io_failure(struct inode *inode, u64 start, u64 length, u64 logical,
        kfree(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);
@@ -2042,7 +2042,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
@@ -2201,7 +2201,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) {
@@ -2211,7 +2211,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;
@@ -2386,7 +2386,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)
@@ -2401,7 +2401,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",
@@ -2438,7 +2438,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;
@@ -2592,7 +2592,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,
@@ -3232,7 +3232,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;
                }
                /*
@@ -3509,7 +3509,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);
@@ -3728,7 +3728,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;
@@ -5156,7 +5156,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 78812587e489ccc352c95bfe7dad4482440aa890..9f2cafae13c55b7fe8ac693f9fdd8b2a1233f349 100644 (file)
@@ -341,7 +341,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 f25d441a5d1eb257bae5762f7c97df2d3f52313a..2a8b2d99671dd77d8c4ec5c3de09f99a399cf6b3 100644 (file)
@@ -1300,7 +1300,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;
@@ -2039,7 +2039,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.
@@ -2071,7 +2071,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 f16c5d70934a5ae03e84c5ac9b598b08c4bf8588..25900b1468f719fd12baa7a5a156d75cd93b40e8 100644 (file)
@@ -354,7 +354,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;
                        }
                }
        }
@@ -413,7 +413,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;
@@ -468,7 +468,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;
index bc3234935d78807938b03aa53a4b34b396f243ff..6792cf33a71fa39860e392c95bf1de00e8389856 100644 (file)
@@ -2784,7 +2784,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;
        }
 
@@ -3019,7 +3019,7 @@ zeroit:
        kunmap_atomic(kaddr);
        if (csum_expected == 0)
                return 0;
-       return -EIO;
+       return -EIEIO;
 }
 
 /*
@@ -4500,7 +4500,7 @@ again:
                        goto again;
                }
                if (!PageUptodate(page)) {
-                       ret = -EIO;
+                       ret = -EIEIO;
                        goto out_unlock;
                }
        }
@@ -6710,7 +6710,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;
        }
 
@@ -7525,7 +7525,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)
@@ -7539,7 +7539,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,
@@ -7943,7 +7943,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;
@@ -8427,7 +8427,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;
index e4f42388081d1707699f0bd10b7a934d8517ab51..10a05f39f7d2c5e9da9a612f337d11f4c1d1a380 100644 (file)
@@ -1191,7 +1191,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 b23d024c0234aefd9898a1d8960e0341dadb749a..3cac9a7da902f5a36bffdaf16a3f2af54ba710bc 100644 (file)
@@ -771,7 +771,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 6a41631cb95988c89e23ffdcb6bdc2466c065b2d..a9a98bb1c41400a7a5b4d287b1a9249c165cbee4 100644 (file)
@@ -865,7 +865,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->bbio->error) > rbio->bbio->max_errors)
-               err = -EIO;
+               err = -EIEIO;
 
        rbio_orig_end_io(rbio, err, 0);
        return;
@@ -1261,7 +1261,7 @@ static noinline void finish_rmw(struct btrfs_raid_bio *rbio)
        return;
 
 cleanup:
-       rbio_orig_end_io(rbio, -EIO, 0);
+       rbio_orig_end_io(rbio, -EIEIO, 0);
 }
 
 /*
@@ -1315,7 +1315,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)
 {
@@ -1337,7 +1337,7 @@ static int fail_rbio_index(struct btrfs_raid_bio *rbio, int failed)
                rbio->failb = failed;
                atomic_inc(&rbio->bbio->error);
        } else {
-               ret = -EIO;
+               ret = -EIEIO;
        }
 out:
        spin_unlock_irqrestore(&rbio->bio_list_lock, flags);
@@ -1355,7 +1355,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);
 }
@@ -1411,7 +1411,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)
@@ -1522,8 +1522,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);
@@ -1781,7 +1781,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;
                                }
                                /*
@@ -1806,7 +1806,7 @@ static void __raid_recover_end_io(struct btrfs_raid_bio *rbio)
                         */
                        if (rbio->raid_map[failb] == RAID6_Q_STRIPE) {
                                if (rbio->raid_map[faila] == RAID5_P_STRIPE) {
-                                       err = -EIO;
+                                       err = -EIEIO;
                                        goto cleanup;
                                }
                                /*
@@ -1921,7 +1921,7 @@ static void raid_recover_end_io(struct bio *bio, int err)
                return;
 
        if (atomic_read(&rbio->bbio->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);
 }
@@ -2022,8 +2022,8 @@ out:
 
 cleanup:
        if (rbio->read_rebuild)
-               rbio_orig_end_io(rbio, -EIO, 0);
-       return -EIO;
+               rbio_orig_end_io(rbio, -EIEIO, 0);
+       return -EIEIO;
 }
 
 /*
@@ -2053,7 +2053,7 @@ int raid56_parity_recover(struct btrfs_root *root, struct bio *bio,
                kfree(raid_map);
                kfree(bbio);
                kfree(rbio);
-               return -EIO;
+               return -EIEIO;
        }
 
        /*
index 74257d6436adda1b772d8658be41202093ef577a..160b382946fa72be4432f4f6fe55383c5369bd6e 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);
@@ -2874,7 +2874,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 197e3dffe8c4ab46b1d8fc4ba30321feb0223dcf..6309030b219df374638b3b7fecf3e2b49485e4ab 100644 (file)
@@ -683,7 +683,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,
@@ -737,7 +737,7 @@ out:
                return 1;
        }
 
-       return -EIO;
+       return -EIEIO;
 }
 
 static void scrub_fixup_nodatasum(struct btrfs_work *work)
@@ -812,7 +812,7 @@ out:
 
 /*
  * 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
@@ -1230,7 +1230,7 @@ static int scrub_setup_recheck_block(struct scrub_ctx *sctx,
                                      &mapped_length, &bbio, 0);
                if (ret || !bbio || mapped_length < sublen) {
                        kfree(bbio);
-                       return -EIO;
+                       return -EIEIO;
                }
 
                BUG_ON(page_index >= SCRUB_PAGES_PER_RD_BIO);
@@ -1435,19 +1435,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)) {
@@ -1457,7 +1457,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);
        }
@@ -1551,7 +1551,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;
@@ -1891,7 +1891,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);
        }
@@ -1956,7 +1956,7 @@ again:
                if (sbio->page_count < 1) {
                        bio_put(sbio->bio);
                        sbio->bio = NULL;
-                       return -EIO;
+                       return -EIEIO;
                }
                scrub_submit(sctx);
                goto again;
@@ -2766,7 +2766,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) {
@@ -2800,7 +2800,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)
@@ -2949,7 +2949,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);
@@ -3400,7 +3400,7 @@ again:
                                goto again;
                        }
                        if (!PageUptodate(page)) {
-                               ret = -EIO;
+                               ret = -EIEIO;
                                goto next_page;
                        }
                }
@@ -3438,11 +3438,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) {
@@ -3459,7 +3459,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 13d18742bc8f0f6e874fad5e72cd854558557790..5818adb8880aad383a45aa4893d3d361708c2e93 100644 (file)
@@ -524,7 +524,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;
@@ -1342,7 +1342,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;
        }
 
@@ -1387,7 +1387,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",
@@ -4317,7 +4317,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 abfb350f022be9c828921ecc1641021b40f68cfa..55fb74b74d16bb5c53a5de3ba5c5882b3386a19b 100644 (file)
@@ -75,6 +75,7 @@ static const char *btrfs_decode_error(int errno)
 
        switch (errno) {
        case -EIO:
+               EIEIO;
                errstr = "IO failure";
                break;
        case -ENOMEM:
@@ -242,7 +243,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 3add847d935478ed77df0576a18bc4822f51985a..f4103a391eb9ac51c04850c020a8cfd842dbc330 100644 (file)
@@ -796,7 +796,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);
 
@@ -899,7 +899,7 @@ int btrfs_wait_marked_extents(struct btrfs_root *root,
        }
 
        if (errors && !werr)
-               werr = -EIO;
+               werr = -EIEIO;
 
        return werr;
 }
index 76aeb65ed2b5ba3b46fbf2c8cf763e71ddb13ac2..f61b7a3ad1cfc85df88c10b5ee80528beea4482e 100644 (file)
@@ -619,7 +619,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;
        }
 
@@ -795,7 +795,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;
        }
 
@@ -1195,7 +1195,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;
        }
 
@@ -1486,7 +1486,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);
@@ -1523,7 +1523,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;
@@ -1571,7 +1571,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);
@@ -1616,7 +1616,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);
@@ -1727,7 +1727,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)
@@ -1856,7 +1856,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;
                }
 
@@ -1887,7 +1887,7 @@ again:
                        inode = read_one_inode(root, location.objectid);
                        if (!inode) {
                                kfree(name);
-                               return -EIO;
+                               return -EIEIO;
                        }
 
                        ret = link_to_fixup_dir(trans, root,
@@ -3910,7 +3910,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 41957ae3c2b518c15909b92d16e74d06addf068a..7453441df822a36b833501dba50f9485ab145c4d 100644 (file)
@@ -2551,7 +2551,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 &&
@@ -5020,7 +5020,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;
@@ -5045,7 +5045,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;
                        kfree(tmp_bbio);
                        goto out;
                }
@@ -5080,7 +5080,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;
                        kfree(tmp_bbio);
                        goto out;
                }
@@ -5458,14 +5458,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;
 
@@ -5541,7 +5541,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;
 
@@ -5580,7 +5580,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
@@ -5611,7 +5611,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;
        }
 
@@ -5761,7 +5761,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);
        }
 }
 
@@ -6014,7 +6014,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 =
@@ -6022,7 +6022,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;
@@ -6141,7 +6141,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);
@@ -6149,7 +6149,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) {
                        /*
@@ -6271,7 +6271,7 @@ int btrfs_read_sys_array(struct btrfs_root *root)
                        if (ret)
                                break;
                } else {
-                       ret = -EIO;
+                       ret = -EIEIO;
                        break;
                }
                array_ptr += len;
@@ -6285,7 +6285,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 3462507aeeee01b4134857c36e169b7cf3fa56ab..b824e1caea27cc3884958edb735a6c6c29bf3e2f 100644 (file)
@@ -512,4 +512,13 @@ static inline void btrfs_dev_stat_reset(struct btrfs_device *dev,
 void btrfs_update_commit_device_size(struct btrfs_fs_info *fs_info);
 void btrfs_update_commit_device_bytes_used(struct btrfs_root *root,
                                        struct btrfs_transaction *transaction);
+
+#ifndef EIEIO
+static inline int eieio(const char *file, int line, const char *function) {
+       printk("EIO calculated at %s:%d in %s", file, line, function);
+       return EIO;
+}
+#define EIEIO (eieio(__FILE__, __LINE__, __FUNCTION__))
+#endif
+
 #endif
index 82990b8f872b6d455be25196ee88a97eb82bd932..aced36844ef2f085eaba59f714f0ec59bf9bd362 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 = -EIEIO;
        else
                ret = 0;