diff options
author | 2025-03-28 12:35:05 -0400 | |
---|---|---|
committer | 2025-03-28 12:35:05 -0400 | |
commit | 3c72d3eea97ba6cd41486b1c4ba2c69342b003c2 (patch) | |
tree | 02cf0321b401e2cc0973f94e6453d373ce37aca2 /fs/bcachefs/extents.c | |
parent | bcachefs: Don't return 0 size holes from bch2_seek_hole() (diff) | |
download | wireguard-linux-3c72d3eea97ba6cd41486b1c4ba2c69342b003c2.tar.xz wireguard-linux-3c72d3eea97ba6cd41486b1c4ba2c69342b003c2.zip |
bcachefs: Fix WARN() in bch2_bkey_pick_read_device()
syzbot discovered that this one is possible: we have pointers, but none
of them are to valid devices.
Reported-by: syzbot+336a6e6a2dbb7d4dba9a@syzkaller.appspotmail.com
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to '')
-rw-r--r-- | fs/bcachefs/extents.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/fs/bcachefs/extents.c b/fs/bcachefs/extents.c index ae1a1d917805..ae7c7a177e10 100644 --- a/fs/bcachefs/extents.c +++ b/fs/bcachefs/extents.c @@ -227,8 +227,11 @@ int bch2_bkey_pick_read_device(struct bch_fs *c, struct bkey_s_c k, if (have_io_errors) return -BCH_ERR_data_read_io_err; - WARN_ONCE(1, "unhandled error case in %s\n", __func__); - return -EINVAL; + /* + * If we get here, we have pointers (bkey_ptrs_validate() ensures that), + * but they don't point to valid devices: + */ + return -BCH_ERR_no_devices_valid; } /* KEY_TYPE_btree_ptr: */ |