diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-05-23 01:03:03 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-05-23 01:03:03 -0400 |
commit | 4b382d0643603819e8b48da58efc254cabc22574 (patch) | |
tree | 71ae8bc989af8a0137c065e4741a76dc4e4d4cb8 /drivers/md/bitmap.c | |
parent | bdfbe804c2303cb4b178bb4b5c3e855892472033 (diff) | |
parent | b098636cf04c89db4036fedc778da0acc666ad1a (diff) |
Merge branch 'for-linus' of git://neil.brown.name/md
* 'for-linus' of git://neil.brown.name/md:
md: allow resync_start to be set while an array is active.
md/raid10: reformat some loops with less indenting.
md/raid10: remove unused variable.
md/raid10: make more use of 'slot' in raid10d.
md/raid10: some tidying up in fix_read_error
md/raid1: improve handling of pages allocated for write-behind.
md/raid1: try fix_sync_read_error before process_checks.
md/raid1: tidy up new functions: process_checks and fix_sync_read_error.
md/raid1: split out two sub-functions from sync_request_write
md: make error_handler functions more uniform and correct.
md/multipath: discard ->working_disks in favour of ->degraded
md/raid1: clean up read_balance.
md: simplify raid10 read_balance
md/bitmap: fix saving of events_cleared and other state.
md: reject a re-add request that cannot be honoured.
md: Fix race when creating a new md device.
Diffstat (limited to 'drivers/md/bitmap.c')
-rw-r--r-- | drivers/md/bitmap.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/md/bitmap.c b/drivers/md/bitmap.c index 5c9362792f1d..70bd738b8b99 100644 --- a/drivers/md/bitmap.c +++ b/drivers/md/bitmap.c | |||
@@ -493,11 +493,11 @@ void bitmap_update_sb(struct bitmap *bitmap) | |||
493 | spin_unlock_irqrestore(&bitmap->lock, flags); | 493 | spin_unlock_irqrestore(&bitmap->lock, flags); |
494 | sb = kmap_atomic(bitmap->sb_page, KM_USER0); | 494 | sb = kmap_atomic(bitmap->sb_page, KM_USER0); |
495 | sb->events = cpu_to_le64(bitmap->mddev->events); | 495 | sb->events = cpu_to_le64(bitmap->mddev->events); |
496 | if (bitmap->mddev->events < bitmap->events_cleared) { | 496 | if (bitmap->mddev->events < bitmap->events_cleared) |
497 | /* rocking back to read-only */ | 497 | /* rocking back to read-only */ |
498 | bitmap->events_cleared = bitmap->mddev->events; | 498 | bitmap->events_cleared = bitmap->mddev->events; |
499 | sb->events_cleared = cpu_to_le64(bitmap->events_cleared); | 499 | sb->events_cleared = cpu_to_le64(bitmap->events_cleared); |
500 | } | 500 | sb->state = cpu_to_le32(bitmap->flags); |
501 | /* Just in case these have been changed via sysfs: */ | 501 | /* Just in case these have been changed via sysfs: */ |
502 | sb->daemon_sleep = cpu_to_le32(bitmap->mddev->bitmap_info.daemon_sleep/HZ); | 502 | sb->daemon_sleep = cpu_to_le32(bitmap->mddev->bitmap_info.daemon_sleep/HZ); |
503 | sb->write_behind = cpu_to_le32(bitmap->mddev->bitmap_info.max_write_behind); | 503 | sb->write_behind = cpu_to_le32(bitmap->mddev->bitmap_info.max_write_behind); |
@@ -618,7 +618,7 @@ success: | |||
618 | if (le32_to_cpu(sb->version) == BITMAP_MAJOR_HOSTENDIAN) | 618 | if (le32_to_cpu(sb->version) == BITMAP_MAJOR_HOSTENDIAN) |
619 | bitmap->flags |= BITMAP_HOSTENDIAN; | 619 | bitmap->flags |= BITMAP_HOSTENDIAN; |
620 | bitmap->events_cleared = le64_to_cpu(sb->events_cleared); | 620 | bitmap->events_cleared = le64_to_cpu(sb->events_cleared); |
621 | if (sb->state & cpu_to_le32(BITMAP_STALE)) | 621 | if (bitmap->flags & BITMAP_STALE) |
622 | bitmap->events_cleared = bitmap->mddev->events; | 622 | bitmap->events_cleared = bitmap->mddev->events; |
623 | err = 0; | 623 | err = 0; |
624 | out: | 624 | out: |
@@ -652,9 +652,11 @@ static int bitmap_mask_state(struct bitmap *bitmap, enum bitmap_state bits, | |||
652 | switch (op) { | 652 | switch (op) { |
653 | case MASK_SET: | 653 | case MASK_SET: |
654 | sb->state |= cpu_to_le32(bits); | 654 | sb->state |= cpu_to_le32(bits); |
655 | bitmap->flags |= bits; | ||
655 | break; | 656 | break; |
656 | case MASK_UNSET: | 657 | case MASK_UNSET: |
657 | sb->state &= cpu_to_le32(~bits); | 658 | sb->state &= cpu_to_le32(~bits); |
659 | bitmap->flags &= ~bits; | ||
658 | break; | 660 | break; |
659 | default: | 661 | default: |
660 | BUG(); | 662 | BUG(); |