]> git.baikalelectronics.ru Git - kernel.git/commit
blk-mq: fix updating tags depth
authorMing Lei <ming.lei@redhat.com>
Thu, 2 Aug 2018 10:23:26 +0000 (18:23 +0800)
committerJens Axboe <axboe@kernel.dk>
Thu, 2 Aug 2018 20:41:58 +0000 (14:41 -0600)
commit0424f2ee09d683f1c98b8458755e80f01ecd6d96
tree8a0a8ef6c94333a8d42e76b123d8fadc82af4c35
parent5c81ececeebb1ee121092be0995b776a46ee7f98
blk-mq: fix updating tags depth

The passed 'nr' from userspace represents the total depth, meantime
inside 'struct blk_mq_tags', 'nr_tags' stores the total tag depth,
and 'nr_reserved_tags' stores the reserved part.

There are two issues in blk_mq_tag_update_depth() now:

1) for growing tags, we should have used the passed 'nr', and keep the
number of reserved tags not changed.

2) the passed 'nr' should have been used for checking against
'tags->nr_tags', instead of number of the normal part.

This patch fixes the above two cases, and avoids kernel crash caused
by wrong resizing sbitmap queue.

Cc: "Ewan D. Milne" <emilne@redhat.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Bart Van Assche <bart.vanassche@sandisk.com>
Cc: Omar Sandoval <osandov@fb.com>
Tested by: Marco Patalano <mpatalan@redhat.com>
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-mq-tag.c