Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 176517
b: refs/heads/master
c: 20a34a8
h: refs/heads/master
i:
  176515: a41136d
v: v3
  • Loading branch information
Mikulas Patocka authored and Alasdair G Kergon committed Dec 10, 2009
1 parent 5459247 commit c96a6cf
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 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: b09acf1aa79462bdacfe6744b469a17722a52702
refs/heads/master: 20a34a8ecc7d03eaa5054f58169ebff12f5f1f8c
23 changes: 22 additions & 1 deletion trunk/drivers/md/dm-log.c
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,19 @@ static int rw_header(struct log_c *lc, int rw)
return dm_io(&lc->io_req, 1, &lc->header_location, NULL);
}

static int flush_header(struct log_c *lc)
{
struct dm_io_region null_location = {
.bdev = lc->header_location.bdev,
.sector = 0,
.count = 0,
};

lc->io_req.bi_rw = WRITE_BARRIER;

return dm_io(&lc->io_req, 1, &null_location, NULL);
}

static int read_header(struct log_c *log)
{
int r;
Expand Down Expand Up @@ -616,6 +629,8 @@ static int disk_resume(struct dm_dirty_log *log)

/* write the new header */
r = rw_header(lc, WRITE);
if (!r)
r = flush_header(lc);
if (r) {
DMWARN("%s: Failed to write header on dirty region log device",
lc->log_dev->name);
Expand Down Expand Up @@ -669,7 +684,13 @@ static int disk_flush(struct dm_dirty_log *log)
if (r)
fail_log_device(lc);
else {
lc->touched_dirtied = 0;
if (lc->touched_dirtied) {
r = flush_header(lc);
if (r)
fail_log_device(lc);
else
lc->touched_dirtied = 0;
}
lc->touched_cleaned = 0;
}

Expand Down

0 comments on commit c96a6cf

Please sign in to comment.