lkml.org 
[lkml]   [2019]   [Apr]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    SubjectRe: [PATCH 5.0 19/93] paride/pcd: cleanup queues when detection fails
    Date
    Hi,

    > [ Upstream commit 81b74ac68c28fddb3589ad5d4d5e587baf4bb781 ]
    >
    > The driver allocates queues for all the units it potentially
    > supports. But if we fail to detect any drives, then we fail
    > loading the module without cleaning up those queues. This is
    > now evident with the switch to blk-mq, though the bug has
    > been there forever as far as I can tell.
    >
    > Also fix cleanup through regular module exit.
    >
    > Reported-by: Randy Dunlap <rdunlap@infradead.org>
    > Tested-by: Randy Dunlap <rdunlap@infradead.org>
    > Signed-off-by: Jens Axboe <axboe@kernel.dk>
    > Signed-off-by: Sasha Levin <sashal@kernel.org>

    This commit causes a new problem. And the commit that made the fix
    is f0d1762554014ce0ae347b9f0d088f2c157c8c72.
    I think this commit needs to be applied together.

    Best regards,
    Nobuhiro

    ________________________________________
    差出人: stable-owner@vger.kernel.org <stable-owner@vger.kernel.org> が Greg Kroah-Hartman <gregkh@linuxfoundation.org> の代理で送信
    送信日時: 2019年4月19日 2:56
    宛先: linux-kernel@vger.kernel.org
    CC: Greg Kroah-Hartman; stable@vger.kernel.org; Randy Dunlap; Jens Axboe; Sasha Levin
    件名: [PATCH 5.0 19/93] paride/pcd: cleanup queues when detection fails

    [ Upstream commit 81b74ac68c28fddb3589ad5d4d5e587baf4bb781 ]

    The driver allocates queues for all the units it potentially
    supports. But if we fail to detect any drives, then we fail
    loading the module without cleaning up those queues. This is
    now evident with the switch to blk-mq, though the bug has
    been there forever as far as I can tell.

    Also fix cleanup through regular module exit.

    Reported-by: Randy Dunlap <rdunlap@infradead.org>
    Tested-by: Randy Dunlap <rdunlap@infradead.org>
    Signed-off-by: Jens Axboe <axboe@kernel.dk>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    ---
    drivers/block/paride/pcd.c | 6 +++++-
    1 file changed, 5 insertions(+), 1 deletion(-)

    diff --git a/drivers/block/paride/pcd.c b/drivers/block/paride/pcd.c
    index 96670eefaeb2..377a694dc228 100644
    --- a/drivers/block/paride/pcd.c
    +++ b/drivers/block/paride/pcd.c
    @@ -749,8 +749,12 @@ static int pcd_detect(void)
    return 0;

    printk("%s: No CD-ROM drive found\n", name);
    - for (unit = 0, cd = pcd; unit < PCD_UNITS; unit++, cd++)
    + for (unit = 0, cd = pcd; unit < PCD_UNITS; unit++, cd++) {
    + blk_cleanup_queue(cd->disk->queue);
    + cd->disk->queue = NULL;
    + blk_mq_free_tag_set(&cd->tag_set);
    put_disk(cd->disk);
    + }
    pi_unregister_driver(par_drv);
    return -1;
    }
    --
    2.19.1


    \
     
     \ /
      Last update: 2019-04-19 20:52    [W:2.251 / U:0.024 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site