summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2016-09-09 01:50:41 -0800
committerKent Overstreet <kent.overstreet@gmail.com>2016-09-09 01:50:41 -0800
commit8baf2a74bf1f47fce47685cb64a1876ab3166097 (patch)
tree8040197d334875138f7f526cbac2b8f1c23b51f4
parentae3a16bea46d83272f57f7055ef1a2a8b2de4f7c (diff)
bcache: write superblock with FUA
will at least make torn superblock writes less likely
-rw-r--r--drivers/md/bcache/super.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c
index b4f6e6b0c7a7..50294a32cf96 100644
--- a/drivers/md/bcache/super.c
+++ b/drivers/md/bcache/super.c
@@ -412,7 +412,7 @@ retry:
if (order > sb->page_order)
goto retry;
- err = "Bad checksum";
+ err = "bad checksum reading superblock";
if (le64_to_cpu(sb->sb->csum) !=
__csum_set(sb->sb, le16_to_cpu(sb->sb->u64s),
le64_to_cpu(sb->sb->version) <
@@ -432,7 +432,7 @@ void __write_super(struct cache_set *c, struct bcache_superblock *disk_sb)
struct cache_sb *sb = disk_sb->sb;
struct bio *bio = disk_sb->bio;
- bio->bi_rw |= (REQ_WRITE|REQ_SYNC|REQ_META);
+ bio->bi_rw |= (REQ_WRITE|REQ_SYNC|REQ_META|REQ_FUA);
bio->bi_bdev = disk_sb->bdev;
bio->bi_iter.bi_sector = SB_SECTOR;
bio->bi_iter.bi_size =