Commit 65f53338 authored by Zhao Lei's avatar Zhao Lei Committed by Chris Mason

btrfs: cleanup noused initialization of dev in btrfs_end_bio()

It is introduced by:
 c404e0dc
 Btrfs: fix use-after-free in the finishing procedure of the device replace

But seems no relationship with that bug, this patch revirt these
code block for cleanup.
Signed-off-by: default avatarZhao Lei <zhaolei@cn.fujitsu.com>
Signed-off-by: default avatarChris Mason <clm@fb.com>
parent fe759907
...@@ -5715,7 +5715,6 @@ static inline void btrfs_end_bbio(struct btrfs_bio *bbio, struct bio *bio, int e ...@@ -5715,7 +5715,6 @@ static inline void btrfs_end_bbio(struct btrfs_bio *bbio, struct bio *bio, int e
static void btrfs_end_bio(struct bio *bio, int err) static void btrfs_end_bio(struct bio *bio, int err)
{ {
struct btrfs_bio *bbio = bio->bi_private; struct btrfs_bio *bbio = bio->bi_private;
struct btrfs_device *dev = bbio->stripes[0].dev;
int is_orig_bio = 0; int is_orig_bio = 0;
if (err) { if (err) {
...@@ -5723,6 +5722,7 @@ static void btrfs_end_bio(struct bio *bio, int err) ...@@ -5723,6 +5722,7 @@ static void btrfs_end_bio(struct bio *bio, int err)
if (err == -EIO || err == -EREMOTEIO) { if (err == -EIO || err == -EREMOTEIO) {
unsigned int stripe_index = unsigned int stripe_index =
btrfs_io_bio(bio)->stripe_index; btrfs_io_bio(bio)->stripe_index;
struct btrfs_device *dev;
BUG_ON(stripe_index >= bbio->num_stripes); BUG_ON(stripe_index >= bbio->num_stripes);
dev = bbio->stripes[stripe_index].dev; dev = bbio->stripes[stripe_index].dev;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment