diff options
author | Mike Snitzer <snitzer@redhat.com> | 2019-04-15 16:40:08 -0400 |
---|---|---|
committer | Mike Snitzer <snitzer@redhat.com> | 2019-04-18 16:18:33 -0400 |
commit | a1ed4d9e937678d15990694c32e1d104e54e97a3 (patch) | |
tree | 85e923dcefefb8bd42522b0e7f7c5aca407bc887 /drivers | |
parent | c6e086e0c9b2133f38563707c96b22fd0906f570 (diff) | |
download | linux-stable-a1ed4d9e937678d15990694c32e1d104e54e97a3.tar.gz linux-stable-a1ed4d9e937678d15990694c32e1d104e54e97a3.tar.bz2 linux-stable-a1ed4d9e937678d15990694c32e1d104e54e97a3.zip |
dm thin metadata: check __commit_transaction()'s return
Fix __reserve_metadata_snap() to return early if __commit_transaction()
fails.
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/md/dm-thin-metadata.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/md/dm-thin-metadata.c b/drivers/md/dm-thin-metadata.c index ed3caceaed07..7381e477a945 100644 --- a/drivers/md/dm-thin-metadata.c +++ b/drivers/md/dm-thin-metadata.c @@ -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. |