]> git.baikalelectronics.ru Git - kernel.git/commit
md: Remove extra mddev_get() in md_seq_start()
authorLogan Gunthorpe <logang@deltatee.com>
Thu, 8 Sep 2022 16:15:15 +0000 (10:15 -0600)
committerSong Liu <song@kernel.org>
Thu, 22 Sep 2022 07:05:04 +0000 (00:05 -0700)
commite7e5cbf737296e7a19b3125242f9ab9eea25ec7d
tree3cd0f9504dd11972a378238e770f4e158d3ec624
parent5ac9a203239135e721fc834177adb53f92d68957
md: Remove extra mddev_get() in md_seq_start()

A regression is seen where mddev devices stay permanently after they
are stopped due to an elevated reference count.

This was tracked down to an extra mddev_get() in md_seq_start().

It only happened rarely because most of the time the md_seq_start()
is called with a zero offset. The path with an extra mddev_get() only
happens when it starts with a non-zero offset.

The commit noted below changed an mddev_get() to check its success
but inadvertently left the original call in. Remove the extra call.

Fixes: c696c9a015fc ("md: only delete entries from all_mddevs when the disk is freed")
Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Acked-by: Guoqing Jiang <Guoqing.jiang@linux.dev>
Signed-off-by: Song Liu <song@kernel.org>
drivers/md/md.c