pr_debug("added bi b#%llu to stripe s#%llu, disk %d.\n",
(unsigned long long)(*bip)->bi_sector,
(unsigned long long)sh->sector, dd_idx);
After spin_unlock_irq, this thread scheded and toread may become null.
So it will be oops.
Signed-off-by: Jianpeng Ma <redacted>
---
drivers/md/raid5.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
@@ -2356,6 +2356,7 @@ static int add_stripe_bio(struct stripe_head *sh, struct bio *bi, int dd_idx, instructbio**bip;structr5conf*conf=sh->raid_conf;intfirstwrite=0;+sector_tsector=bi->bi_sector;pr_debug("adding bi b#%llu to stripe s#%llu\n",(unsignedlonglong)bi->bi_sector,
@@ -2406,7 +2407,7 @@ static int add_stripe_bio(struct stripe_head *sh, struct bio *bi, int dd_idx, inspin_unlock_irq(&sh->stripe_lock);pr_debug("added bi b#%llu to stripe s#%llu, disk %d.\n",-(unsignedlonglong)(*bip)->bi_sector,+(unsignedlonglong)sector,(unsignedlonglong)sh->sector,dd_idx);if(conf->mddev->bitmap&&firstwrite){
pr_debug("added bi b#%llu to stripe s#%llu, disk %d.\n",
(unsigned long long)(*bip)->bi_sector,
(unsigned long long)sh->sector, dd_idx);
After spin_unlock_irq, this thread scheded and toread may become null.
So it will be oops.
Signed-off-by: Jianpeng Ma <redacted>
---
drivers/md/raid5.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
@@ -2356,6 +2356,7 @@ static int add_stripe_bio(struct stripe_head *sh, struct bio *bi, int dd_idx, instructbio**bip;structr5conf*conf=sh->raid_conf;intfirstwrite=0;+sector_tsector=bi->bi_sector;pr_debug("adding bi b#%llu to stripe s#%llu\n",(unsignedlonglong)bi->bi_sector,
@@ -2406,7 +2407,7 @@ static int add_stripe_bio(struct stripe_head *sh, struct bio *bi, int dd_idx, inspin_unlock_irq(&sh->stripe_lock);pr_debug("added bi b#%llu to stripe s#%llu, disk %d.\n",-(unsignedlonglong)(*bip)->bi_sector,+(unsignedlonglong)sector,(unsignedlonglong)sh->sector,dd_idx);if(conf->mddev->bitmap&&firstwrite){
how about we just move the spin_unlock_irq after the pr_debug??
NeilBrown
pr_debug("added bi b#%llu to stripe s#%llu, disk %d.\n",
(unsigned long long)(*bip)->bi_sector,
(unsigned long long)sh->sector, dd_idx);
After spin_unlock_irq, this thread scheded and toread may become null.
So it will be oops.
Signed-off-by: Jianpeng Ma <redacted>
---
drivers/md/raid5.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
@@ -2356,6 +2356,7 @@ static int add_stripe_bio(struct stripe_head *sh, struct bio *bi, int dd_idx, instructbio**bip;structr5conf*conf=sh->raid_conf;intfirstwrite=0;+sector_tsector=bi->bi_sector;pr_debug("adding bi b#%llu to stripe s#%llu\n",(unsignedlonglong)bi->bi_sector,
@@ -2406,7 +2407,7 @@ static int add_stripe_bio(struct stripe_head *sh, struct bio *bi, int dd_idx, inspin_unlock_irq(&sh->stripe_lock);pr_debug("added bi b#%llu to stripe s#%llu, disk %d.\n",-(unsignedlonglong)(*bip)->bi_sector,+(unsignedlonglong)sector,(unsignedlonglong)sh->sector,dd_idx);if(conf->mddev->bitmap&&firstwrite){
how about we just move the spin_unlock_irq after the pr_debug??
ah! Why are you think ? my method only add a parameter.
BTW, in func handle_failed_stripe:
quoted
if (!test_bit(R5_Wantfill, &sh->dev[i].flags) &&
(!test_bit(R5_Insync, &sh->dev[i].flags) ||
test_bit(R5_ReadError, &sh->dev[i].flags))) {
bi = sh->dev[i].toread;
sh->dev[i].toread = NULL;
if (test_and_clear_bit(R5_Overlap, &sh->dev[i].flags))
wake_up(&conf->wait_for_overlap);
pr_debug("added bi b#%llu to stripe s#%llu, disk %d.\n",
(unsigned long long)(*bip)->bi_sector,
(unsigned long long)sh->sector, dd_idx);
After spin_unlock_irq, this thread scheded and toread may become null.
So it will be oops.
Signed-off-by: Jianpeng Ma <redacted>
---
drivers/md/raid5.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
@@ -2356,6 +2356,7 @@ static int add_stripe_bio(struct stripe_head *sh, struct bio *bi, int dd_idx, instructbio**bip;structr5conf*conf=sh->raid_conf;intfirstwrite=0;+sector_tsector=bi->bi_sector;pr_debug("adding bi b#%llu to stripe s#%llu\n",(unsignedlonglong)bi->bi_sector,
@@ -2406,7 +2407,7 @@ static int add_stripe_bio(struct stripe_head *sh, struct bio *bi, int dd_idx, inspin_unlock_irq(&sh->stripe_lock);pr_debug("added bi b#%llu to stripe s#%llu, disk %d.\n",-(unsignedlonglong)(*bip)->bi_sector,+(unsignedlonglong)sector,(unsignedlonglong)sh->sector,dd_idx);if(conf->mddev->bitmap&&firstwrite){
how about we just move the spin_unlock_irq after the pr_debug??
ah! Why are you think ? my method only add a parameter.
Yes.
BTW, in func handle_failed_stripe:
quoted
quoted
if (!test_bit(R5_Wantfill, &sh->dev[i].flags) &&
(!test_bit(R5_Insync, &sh->dev[i].flags) ||
test_bit(R5_ReadError, &sh->dev[i].flags))) {
bi = sh->dev[i].toread;
sh->dev[i].toread = NULL;
if (test_and_clear_bit(R5_Overlap, &sh->dev[i].flags))
wake_up(&conf->wait_for_overlap);
Why use stripe_lock to protect toread?
I assume you mean that we should be holding the lock to protect toread, but
we aren't.
I've queued a patch to fix that.
Thanks.
NeilBrown
pr_debug("added bi b#%llu to stripe s#%llu, disk %d.\n",
(unsigned long long)(*bip)->bi_sector,
(unsigned long long)sh->sector, dd_idx);
After spin_unlock_irq, this thread scheded and toread may become null.
So it will be oops.
Signed-off-by: Jianpeng Ma <redacted>
---
drivers/md/raid5.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
@@ -2356,6 +2356,7 @@ static int add_stripe_bio(struct stripe_head *sh, struct bio *bi, int dd_idx, instructbio**bip;structr5conf*conf=sh->raid_conf;intfirstwrite=0;+sector_tsector=bi->bi_sector;pr_debug("adding bi b#%llu to stripe s#%llu\n",(unsignedlonglong)bi->bi_sector,
@@ -2406,7 +2407,7 @@ static int add_stripe_bio(struct stripe_head *sh, struct bio *bi, int dd_idx, inspin_unlock_irq(&sh->stripe_lock);pr_debug("added bi b#%llu to stripe s#%llu, disk %d.\n",-(unsignedlonglong)(*bip)->bi_sector,+(unsignedlonglong)sector,(unsignedlonglong)sh->sector,dd_idx);if(conf->mddev->bitmap&&firstwrite){
how about we just move the spin_unlock_irq after the pr_debug??
ah! Why are you think ? my method only add a parameter.
Yes.
quoted
BTW, in func handle_failed_stripe:
quoted
quoted
if (!test_bit(R5_Wantfill, &sh->dev[i].flags) &&
(!test_bit(R5_Insync, &sh->dev[i].flags) ||
test_bit(R5_ReadError, &sh->dev[i].flags))) {
bi = sh->dev[i].toread;
sh->dev[i].toread = NULL;
if (test_and_clear_bit(R5_Overlap, &sh->dev[i].flags))
wake_up(&conf->wait_for_overlap);
Why use stripe_lock to protect toread?
I assume you mean that we should be holding the lock to protect toread, but
we aren't.
I've queued a patch to fix that.
Hi,
Last Saturday, i sent a patch-set which contained a patch which fix this bug.
You can check your mail!
Thanks!