copy: safeguard negative positions

This commit is contained in:
Thomas Schoebel-Theuer 2021-04-16 10:33:51 +02:00
parent 89c29da9c5
commit c7fd43b03d
1 changed files with 2 additions and 2 deletions

View File

@ -158,8 +158,8 @@ unsigned _determine_input(struct copy_brick *brick, struct mref_object *mref)
return INPUT_A_IO;
}
#define GET_INDEX(pos) (((pos) / COPY_CHUNK) % NR_COPY_REQUESTS)
#define GET_OFFSET(pos) ((pos) % COPY_CHUNK)
#define GET_INDEX(pos) (((unsigned long)(pos) / COPY_CHUNK) % NR_COPY_REQUESTS)
#define GET_OFFSET(pos) ((unsigned long)(pos) % COPY_CHUNK)
static
void __clear_mref(struct copy_brick *brick, struct mref_object *mref, unsigned queue)