diff options
author | Joe Thornber <ejt@redhat.com> | 2013-12-13 13:31:08 +0100 |
---|---|---|
committer | Mike Snitzer <snitzer@redhat.com> | 2013-12-13 20:22:09 +0100 |
commit | 5b564d80f8bc21094c0cd2b19b679d983aabcc29 (patch) | |
tree | 942293da24619a5befb57d03e4a94db9b243710c /drivers/md/persistent-data/dm-array.c | |
parent | dm stats: initialize read-only module parameter (diff) | |
download | linux-5b564d80f8bc21094c0cd2b19b679d983aabcc29.tar.xz linux-5b564d80f8bc21094c0cd2b19b679d983aabcc29.zip |
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 '')
0 files changed, 0 insertions, 0 deletions