mirror of
https://github.com/schoebel/mars
synced 2024-12-29 18:32:47 +00:00
if: safeguard hash_index
This commit is contained in:
parent
16d623c25b
commit
d619051ff3
@ -331,7 +331,7 @@ void _if_unplug(struct if_input *input)
|
||||
while (!list_empty(&tmp_list)) {
|
||||
struct if_mref_aspect *mref_a;
|
||||
struct mref_object *mref;
|
||||
int hash_index;
|
||||
unsigned int hash_index;
|
||||
unsigned long flags;
|
||||
|
||||
mref_a = container_of(tmp_list.next, struct if_mref_aspect, plug_head);
|
||||
@ -620,7 +620,7 @@ void if_make_request(struct request_queue *q, struct bio *bio)
|
||||
|
||||
while (bv_len > 0) {
|
||||
struct list_head *tmp;
|
||||
int hash_index;
|
||||
unsigned int hash_index;
|
||||
int this_len = 0;
|
||||
unsigned long flags;
|
||||
|
||||
@ -629,7 +629,7 @@ void if_make_request(struct request_queue *q, struct bio *bio)
|
||||
|
||||
MARS_IO("rw = %d i = %d pos = %lld bv_page = %p bv_offset = %d data = %p bv_len = %d\n", rw, i, pos, bvec->bv_page, bvec->bv_offset, data, bv_len);
|
||||
|
||||
hash_index = (pos / IF_HASH_CHUNK) % IF_HASH_MAX;
|
||||
hash_index = ((unsigned long)pos / IF_HASH_CHUNK) % IF_HASH_MAX;
|
||||
|
||||
#ifdef REQUEST_MERGING
|
||||
traced_lock(&input->hash_table[hash_index].hash_lock, flags);
|
||||
|
@ -56,7 +56,7 @@ struct if_mref_aspect {
|
||||
GENERIC_ASPECT(mref);
|
||||
struct list_head plug_head;
|
||||
struct list_head hash_head;
|
||||
int hash_index;
|
||||
unsigned int hash_index;
|
||||
int bio_count;
|
||||
int current_len;
|
||||
int max_len;
|
||||
|
Loading…
Reference in New Issue
Block a user