diff options
author | Joe Thornber <ejt@redhat.com> | 2012-07-27 15:08:06 +0100 |
---|---|---|
committer | Alasdair G Kergon <agk@redhat.com> | 2012-07-27 15:08:06 +0100 |
commit | 8d44c98aac540cdf3cb5385bc6ef8d56930c7d70 (patch) | |
tree | abc7ac2ad9e95a8110374596001c0af40db33683 /drivers/md | |
parent | 600497013687516153cb82637acfe56f7eb9308a (diff) |
dm persistent data: always unlock superblock in dm_bm_flush_and_unlock
Unlock the superblock even if initial dm_bufio_write_dirty_buffers fails.
Also, remove redundant flush calls. dm_bm_flush_and_unlock's calls to
dm_bufio_write_dirty_buffers already result in dm_bufio_issue_flush
being called.
This avoids warnings about unflushed dirty buffers from bufio.
Signed-off-by: Joe Thornber <ejt@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Diffstat (limited to 'drivers/md')
-rw-r--r-- | drivers/md/persistent-data/dm-block-manager.c | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/drivers/md/persistent-data/dm-block-manager.c b/drivers/md/persistent-data/dm-block-manager.c index 0317ecdc6e53..8ec46dd511f9 100644 --- a/drivers/md/persistent-data/dm-block-manager.c +++ b/drivers/md/persistent-data/dm-block-manager.c @@ -587,22 +587,14 @@ int dm_bm_flush_and_unlock(struct dm_block_manager *bm, int r; r = dm_bufio_write_dirty_buffers(to_bufio(bm)); - if (unlikely(r)) - return r; - r = dm_bufio_issue_flush(to_bufio(bm)); - if (unlikely(r)) + if (unlikely(r)) { + dm_bm_unlock(superblock); return r; + } dm_bm_unlock(superblock); - r = dm_bufio_write_dirty_buffers(to_bufio(bm)); - if (unlikely(r)) - return r; - r = dm_bufio_issue_flush(to_bufio(bm)); - if (unlikely(r)) - return r; - - return 0; + return dm_bufio_write_dirty_buffers(to_bufio(bm)); } u32 dm_bm_checksum(const void *data, size_t len, u32 init_xor) |