Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 305949
b: refs/heads/master
c: 62f82fa
h: refs/heads/master
i:
  305947: 5dc9e49
v: v3
  • Loading branch information
NeilBrown committed May 22, 2012
1 parent ae381e9 commit 1e71647
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 13 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: 7466712347c58c367636cc875801c8703bc729e7
refs/heads/master: 62f82faaceb483284ea938b3a092b9f0a4d2d029
18 changes: 6 additions & 12 deletions trunk/drivers/md/bitmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -739,7 +739,6 @@ static void bitmap_file_unmap(struct bitmap *bitmap)
int pages;
struct bitmap_storage *store = &bitmap->storage;

spin_lock_irq(&bitmap->lock);
map = store->filemap;
store->filemap = NULL;
attr = store->filemap_attr;
Expand All @@ -748,7 +747,6 @@ static void bitmap_file_unmap(struct bitmap *bitmap)
store->file_pages = 0;
sb_page = store->sb_page;
store->sb_page = NULL;
spin_unlock_irq(&bitmap->lock);

while (pages--)
if (map[pages] != sb_page) /* 0 is sb_page, release it below */
Expand All @@ -764,10 +762,8 @@ static void bitmap_file_put(struct bitmap *bitmap)
{
struct file *file;

spin_lock_irq(&bitmap->lock);
file = bitmap->storage.file;
bitmap->storage.file = NULL;
spin_unlock_irq(&bitmap->lock);

if (file)
wait_event(bitmap->write_wait,
Expand Down Expand Up @@ -809,10 +805,6 @@ static void bitmap_file_kick(struct bitmap *bitmap)
"%s: disabling internal bitmap due to errors\n",
bmname(bitmap));
}

bitmap_file_put(bitmap);

return;
}

enum bitmap_page_attr {
Expand Down Expand Up @@ -903,7 +895,8 @@ void bitmap_unplug(struct bitmap *bitmap)
int dirty, need_write;
int wait = 0;

if (!bitmap || !bitmap->storage.filemap)
if (!bitmap || !bitmap->storage.filemap ||
test_bit(BITMAP_STALE, &bitmap->flags))
return;

/* look at each page to see if there are any set bits that need to be
Expand Down Expand Up @@ -1222,7 +1215,10 @@ void bitmap_daemon_work(struct mddev *mddev)
* the first blocking holds the superblock and it has been updated.
* We mustn't write any other blocks before the superblock.
*/
for (j = 0; j < bitmap->storage.file_pages; j++) {
for (j = 0;
j < bitmap->storage.file_pages
&& !test_bit(BITMAP_STALE, &bitmap->flags);
j++) {

if (test_page_attr(bitmap, j,
BITMAP_PAGE_DIRTY))
Expand All @@ -1235,8 +1231,6 @@ void bitmap_daemon_work(struct mddev *mddev)
spin_unlock_irq(&bitmap->lock);
write_page(bitmap, bitmap->storage.filemap[j], 0);
spin_lock_irq(&bitmap->lock);
if (!bitmap->storage.filemap)
break;
}
}
spin_unlock_irq(&bitmap->lock);
Expand Down

0 comments on commit 1e71647

Please sign in to comment.