aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/bitmap.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/md/bitmap.c')
-rw-r--r--drivers/md/bitmap.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/md/bitmap.c b/drivers/md/bitmap.c
index f197db2ef92d..9462fdd517c0 100644
--- a/drivers/md/bitmap.c
+++ b/drivers/md/bitmap.c
@@ -350,8 +350,7 @@ int bitmap_update_sb(struct bitmap *bitmap)
350 if (!bitmap->mddev->degraded) 350 if (!bitmap->mddev->degraded)
351 sb->events_cleared = cpu_to_le64(bitmap->mddev->events); 351 sb->events_cleared = cpu_to_le64(bitmap->mddev->events);
352 kunmap(bitmap->sb_page); 352 kunmap(bitmap->sb_page);
353 write_page(bitmap->sb_page, 0); 353 return write_page(bitmap->sb_page, 0);
354 return 0;
355} 354}
356 355
357/* print out the bitmap file superblock */ 356/* print out the bitmap file superblock */
@@ -735,7 +734,8 @@ int bitmap_unplug(struct bitmap *bitmap)
735 spin_unlock_irqrestore(&bitmap->lock, flags); 734 spin_unlock_irqrestore(&bitmap->lock, flags);
736 735
737 if (attr & (BITMAP_PAGE_DIRTY | BITMAP_PAGE_NEEDWRITE)) 736 if (attr & (BITMAP_PAGE_DIRTY | BITMAP_PAGE_NEEDWRITE))
738 write_page(page, 0); 737 if (write_page(page, 0))
738 return 1;
739 } 739 }
740 if (wait) { /* if any writes were performed, we need to wait on them */ 740 if (wait) { /* if any writes were performed, we need to wait on them */
741 spin_lock_irq(&bitmap->write_lock); 741 spin_lock_irq(&bitmap->write_lock);
@@ -950,7 +950,7 @@ int bitmap_daemon_work(struct bitmap *bitmap)
950 if (get_page_attr(bitmap, lastpage) & BITMAP_PAGE_NEEDWRITE) { 950 if (get_page_attr(bitmap, lastpage) & BITMAP_PAGE_NEEDWRITE) {
951 clear_page_attr(bitmap, lastpage, BITMAP_PAGE_NEEDWRITE); 951 clear_page_attr(bitmap, lastpage, BITMAP_PAGE_NEEDWRITE);
952 spin_unlock_irqrestore(&bitmap->lock, flags); 952 spin_unlock_irqrestore(&bitmap->lock, flags);
953 write_page(lastpage, 0); 953 err = write_page(lastpage, 0);
954 } else { 954 } else {
955 set_page_attr(bitmap, lastpage, BITMAP_PAGE_NEEDWRITE); 955 set_page_attr(bitmap, lastpage, BITMAP_PAGE_NEEDWRITE);
956 spin_unlock_irqrestore(&bitmap->lock, flags); 956 spin_unlock_irqrestore(&bitmap->lock, flags);
@@ -998,7 +998,7 @@ int bitmap_daemon_work(struct bitmap *bitmap)
998 if (get_page_attr(bitmap, lastpage) &BITMAP_PAGE_NEEDWRITE) { 998 if (get_page_attr(bitmap, lastpage) &BITMAP_PAGE_NEEDWRITE) {
999 clear_page_attr(bitmap, lastpage, BITMAP_PAGE_NEEDWRITE); 999 clear_page_attr(bitmap, lastpage, BITMAP_PAGE_NEEDWRITE);
1000 spin_unlock_irqrestore(&bitmap->lock, flags); 1000 spin_unlock_irqrestore(&bitmap->lock, flags);
1001 write_page(lastpage, 0); 1001 err = write_page(lastpage, 0);
1002 } else { 1002 } else {
1003 set_page_attr(bitmap, lastpage, BITMAP_PAGE_NEEDWRITE); 1003 set_page_attr(bitmap, lastpage, BITMAP_PAGE_NEEDWRITE);
1004 spin_unlock_irqrestore(&bitmap->lock, flags); 1004 spin_unlock_irqrestore(&bitmap->lock, flags);
@@ -1375,7 +1375,8 @@ int bitmap_setallbits(struct bitmap *bitmap)
1375 spin_unlock_irqrestore(&bitmap->lock, flags); 1375 spin_unlock_irqrestore(&bitmap->lock, flags);
1376 memset(kmap(page), 0xff, PAGE_SIZE); 1376 memset(kmap(page), 0xff, PAGE_SIZE);
1377 kunmap(page); 1377 kunmap(page);
1378 write_page(page, 0); 1378 if (write_page(page, 0))
1379 return 1;
1379 } 1380 }
1380 1381
1381 return 0; 1382 return 0;