Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 139950
b: refs/heads/master
c: b0f9ec0
h: refs/heads/master
v: v3
  • Loading branch information
NeilBrown committed Mar 31, 2009
1 parent 0d18cbe commit dc17f77
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2cffc4a01dd90a502324e3453d7b245d6d16e1c2
refs/heads/master: b0f9ec047b79a92e8b8a9dfbf97537c8fbef234a
16 changes: 7 additions & 9 deletions trunk/drivers/md/raid5.c
Original file line number Diff line number Diff line change
Expand Up @@ -3637,10 +3637,9 @@ static int make_request(struct request_queue *q, struct bio * bi)

retry:
previous = 0;
disks = conf->raid_disks;
prepare_to_wait(&conf->wait_for_overlap, &w, TASK_UNINTERRUPTIBLE);
if (likely(conf->reshape_progress == MaxSector))
disks = conf->raid_disks;
else {
if (unlikely(conf->reshape_progress != MaxSector)) {
/* spinlock is needed as reshape_progress may be
* 64bit on a 32bit platform, and so it might be
* possible to see a half-updated value
Expand All @@ -3650,7 +3649,6 @@ static int make_request(struct request_queue *q, struct bio * bi)
* to check again.
*/
spin_lock_irq(&conf->device_lock);
disks = conf->raid_disks;
if (mddev->delta_disks < 0
? logical_sector < conf->reshape_progress
: logical_sector >= conf->reshape_progress) {
Expand Down Expand Up @@ -3679,7 +3677,7 @@ static int make_request(struct request_queue *q, struct bio * bi)
sh = get_active_stripe(conf, new_sector, previous,
(bi->bi_rw&RWA_MASK));
if (sh) {
if (unlikely(conf->reshape_progress != MaxSector)) {
if (unlikely(previous)) {
/* expansion might have moved on while waiting for a
* stripe, so we must do the range check again.
* Expansion could still move past after this
Expand All @@ -3690,10 +3688,9 @@ static int make_request(struct request_queue *q, struct bio * bi)
*/
int must_retry = 0;
spin_lock_irq(&conf->device_lock);
if ((mddev->delta_disks < 0
? logical_sector >= conf->reshape_progress
: logical_sector < conf->reshape_progress)
&& previous)
if (mddev->delta_disks < 0
? logical_sector >= conf->reshape_progress
: logical_sector < conf->reshape_progress)
/* mismatch, need to try again */
must_retry = 1;
spin_unlock_irq(&conf->device_lock);
Expand Down Expand Up @@ -4977,6 +4974,7 @@ static void end_reshape(raid5_conf_t *conf)
conf->previous_raid_disks = conf->raid_disks;
conf->reshape_progress = MaxSector;
spin_unlock_irq(&conf->device_lock);
wake_up(&conf->wait_for_overlap);

/* read-ahead size must cover two whole stripes, which is
* 2 * (datadisks) * chunksize where 'n' is the number of raid devices
Expand Down

0 comments on commit dc17f77

Please sign in to comment.