io_read.c (1f2f92ec3f2e5802c2870d0d34ccfa66ae9216ad) io_read.c (3858aa4268b2f71827097f548879e4405b4cc995)
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Some low level IO code, and hacks for various block layer limitations
4 *
5 * Copyright 2010, 2011 Kent Overstreet <kent.overstreet@gmail.com>
6 * Copyright 2012 Google, Inc.
7 */
8

--- 683 unchanged lines hidden (view full) ---

692 rbio->read_pos.offset,
693 "data read error: %s",
694 bch2_blk_status_to_str(bio->bi_status))) {
695 bch2_rbio_error(rbio, READ_RETRY_AVOID, bio->bi_status);
696 return;
697 }
698
699 if (((rbio->flags & BCH_READ_RETRY_IF_STALE) && race_fault()) ||
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Some low level IO code, and hacks for various block layer limitations
4 *
5 * Copyright 2010, 2011 Kent Overstreet <kent.overstreet@gmail.com>
6 * Copyright 2012 Google, Inc.
7 */
8

--- 683 unchanged lines hidden (view full) ---

692 rbio->read_pos.offset,
693 "data read error: %s",
694 bch2_blk_status_to_str(bio->bi_status))) {
695 bch2_rbio_error(rbio, READ_RETRY_AVOID, bio->bi_status);
696 return;
697 }
698
699 if (((rbio->flags & BCH_READ_RETRY_IF_STALE) && race_fault()) ||
700 ptr_stale(ca, &rbio->pick.ptr)) {
700 dev_ptr_stale(ca, &rbio->pick.ptr)) {
701 trace_and_count(c, read_reuse_race, &rbio->bio);
702
703 if (rbio->flags & BCH_READ_RETRY_IF_STALE)
704 bch2_rbio_error(rbio, READ_RETRY, BLK_STS_AGAIN);
705 else
706 bch2_rbio_error(rbio, READ_ERR, BLK_STS_AGAIN);
707 return;
708 }

--- 127 unchanged lines hidden (view full) ---

836 /*
837 * Stale dirty pointers are treated as IO errors, but @failed isn't
838 * allocated unless we're in the retry path - so if we're not in the
839 * retry path, don't check here, it'll be caught in bch2_read_endio()
840 * and we'll end up in the retry path:
841 */
842 if ((flags & BCH_READ_IN_RETRY) &&
843 !pick.ptr.cached &&
701 trace_and_count(c, read_reuse_race, &rbio->bio);
702
703 if (rbio->flags & BCH_READ_RETRY_IF_STALE)
704 bch2_rbio_error(rbio, READ_RETRY, BLK_STS_AGAIN);
705 else
706 bch2_rbio_error(rbio, READ_ERR, BLK_STS_AGAIN);
707 return;
708 }

--- 127 unchanged lines hidden (view full) ---

836 /*
837 * Stale dirty pointers are treated as IO errors, but @failed isn't
838 * allocated unless we're in the retry path - so if we're not in the
839 * retry path, don't check here, it'll be caught in bch2_read_endio()
840 * and we'll end up in the retry path:
841 */
842 if ((flags & BCH_READ_IN_RETRY) &&
843 !pick.ptr.cached &&
844 unlikely(ptr_stale(ca, &pick.ptr))) {
844 unlikely(dev_ptr_stale(ca, &pick.ptr))) {
845 read_from_stale_dirty_pointer(trans, k, pick.ptr);
846 bch2_mark_io_failure(failed, &pick);
847 goto retry_pick;
848 }
849
850 /*
851 * Unlock the iterator while the btree node's lock is still in
852 * cache, before doing the IO:

--- 367 unchanged lines hidden ---
845 read_from_stale_dirty_pointer(trans, k, pick.ptr);
846 bch2_mark_io_failure(failed, &pick);
847 goto retry_pick;
848 }
849
850 /*
851 * Unlock the iterator while the btree node's lock is still in
852 * cache, before doing the IO:

--- 367 unchanged lines hidden ---