Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a1ed4d9e authored by Mike Snitzer's avatar Mike Snitzer
Browse files

dm thin metadata: check __commit_transaction()'s return



Fix __reserve_metadata_snap() to return early if __commit_transaction()
fails.

Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
parent c6e086e0
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -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.