Skip to content

Commit

Permalink
dm thin metadata: check __commit_transaction()'s return
Browse files Browse the repository at this point in the history
Fix __reserve_metadata_snap() to return early if __commit_transaction()
fails.

Signed-off-by: Mike Snitzer <snitzer@redhat.com>
  • Loading branch information
Mike Snitzer committed Apr 18, 2019
1 parent c6e086e commit a1ed4d9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion drivers/md/dm-thin-metadata.c
Original file line number Diff line number Diff line change
Expand Up @@ -1225,7 +1225,12 @@ static int __reserve_metadata_snap(struct dm_pool_metadata *pmd)
* We commit to ensure the btree roots which we increment in a
* moment are up to date.
*/
__commit_transaction(pmd);
r = __commit_transaction(pmd);
if (r < 0) {
DMWARN("%s: __commit_transaction() failed, error = %d",
__func__, r);
return r;
}

/*
* Copy the superblock.
Expand Down

0 comments on commit a1ed4d9

Please sign in to comment.