diff options
author | Mikulas Patocka <mpatocka@redhat.com> | 2017-04-30 17:32:28 -0400 |
---|---|---|
committer | Mike Snitzer <snitzer@redhat.com> | 2017-05-16 15:12:08 -0400 |
commit | 13840d38016203f0095cd547b90352812d24b787 (patch) | |
tree | 0f45c88b71acfc0a69ebdbf0736746b046faf076 /virt | |
parent | f98e0eb68008aff9824d1c4dad7276c8bab83ca5 (diff) | |
download | linux-13840d38016203f0095cd547b90352812d24b787.tar.bz2 |
dm bufio: make the parameter "retain_bytes" unsigned long
Change the type of the parameter "retain_bytes" from unsigned to
unsigned long, so that on 64-bit machines the user can set more than
4GiB of data to be retained.
Also, change the type of the variable "count" in the function
"__evict_old_buffers" to unsigned long. The assignment
"count = c->n_buffers[LIST_CLEAN] + c->n_buffers[LIST_DIRTY];"
could result in unsigned long to unsigned overflow and that could result
in buffers not being freed when they should.
While at it, avoid division in get_retain_buffers(). Division is slow,
we can change it to shift because we have precalculated the log2 of
block size.
Cc: stable@vger.kernel.org
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Diffstat (limited to 'virt')
0 files changed, 0 insertions, 0 deletions