diff options
author | Joe Thornber <ejt@redhat.com> | 2013-12-13 12:31:08 +0000 |
---|---|---|
committer | Mike Snitzer <snitzer@redhat.com> | 2013-12-13 14:22:09 -0500 |
commit | 5b564d80f8bc21094c0cd2b19b679d983aabcc29 (patch) | |
tree | 942293da24619a5befb57d03e4a94db9b243710c /drivers/md/persistent-data/dm-space-map-common.h | |
parent | 76f5bee5c3b45c617f91243e85547fc8f67bc678 (diff) | |
download | op-kernel-dev-5b564d80f8bc21094c0cd2b19b679d983aabcc29.zip op-kernel-dev-5b564d80f8bc21094c0cd2b19b679d983aabcc29.tar.gz |
dm space map: disallow decrementing a reference count below zero
The old behaviour, returning -EINVAL if a ref_count of 0 would be
decremented, was removed in commit f722063 ("dm space map: optimise
sm_ll_dec and sm_ll_inc"). To fix this regression we return an error
code from the mutator function pointer passed to sm_ll_mutate() and have
dec_ref_count() return -EINVAL if the old ref_count is 0.
Add a DMERR to reflect the potential seriousness of this error.
Also, add missing dm_tm_unlock() to sm_ll_mutate()'s error path.
With this fix the following dmts regression test now passes:
dmtest run --suite cache -n /metadata_use_kernel/
The next patch fixes the higher-level dm-array code that exposed this
regression.
Signed-off-by: Joe Thornber <ejt@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Cc: stable@vger.kernel.org # 3.12+
Diffstat (limited to 'drivers/md/persistent-data/dm-space-map-common.h')
0 files changed, 0 insertions, 0 deletions