lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJZ5v0jAQnEHedZs7kQmfHx4KTw9G1wrObuEpid_m5uVk5qoJQ@mail.gmail.com>
Date:   Fri, 18 Sep 2020 18:01:59 +0200
From:   "Rafael J. Wysocki" <rafael@...nel.org>
To:     Christoph Hellwig <hch@....de>
Cc:     Jens Axboe <axboe@...nel.dk>, Josef Bacik <josef@...icpanda.com>,
        Minchan Kim <minchan@...nel.org>,
        Stefan Haberland <sth@...ux.ibm.com>,
        Jan Hoeppner <hoeppner@...ux.ibm.com>,
        Joseph Qi <joseph.qi@...ux.alibaba.com>,
        "Rafael J. Wysocki" <rjw@...ysocki.net>,
        Pavel Machek <pavel@....cz>, Len Brown <len.brown@...el.com>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        nbd@...er.debian.org,
        "open list:LIBATA SUBSYSTEM (Serial and Parallel ATA drivers)" 
        <linux-ide@...r.kernel.org>, linux-s390@...r.kernel.org,
        linux-fsdevel@...r.kernel.org, ocfs2-devel@....oracle.com,
        Linux PM <linux-pm@...r.kernel.org>,
        Linux Memory Management List <linux-mm@...ck.org>,
        linux-block@...r.kernel.org
Subject: Re: [PATCH 13/14] PM: mm: cleanup swsusp_swap_check

On Thu, Sep 17, 2020 at 7:39 PM Christoph Hellwig <hch@....de> wrote:
>
> Use blkdev_get_by_dev instead of bdget + blkdev_get.
>
> Signed-off-by: Christoph Hellwig <hch@....de>

Acked-by: Rafael J. Wysocki <rafael.j.wysocki@...el.com>

> ---
>  kernel/power/swap.c | 10 ++++------
>  1 file changed, 4 insertions(+), 6 deletions(-)
>
> diff --git a/kernel/power/swap.c b/kernel/power/swap.c
> index 9d3ffbfe08dbf6..71385bedcc3a49 100644
> --- a/kernel/power/swap.c
> +++ b/kernel/power/swap.c
> @@ -343,12 +343,10 @@ static int swsusp_swap_check(void)
>                 return res;
>         root_swap = res;
>
> -       hib_resume_bdev = bdget(swsusp_resume_device);
> -       if (!hib_resume_bdev)
> -               return -ENOMEM;
> -       res = blkdev_get(hib_resume_bdev, FMODE_WRITE, NULL);
> -       if (res)
> -               return res;
> +       hib_resume_bdev = blkdev_get_by_dev(swsusp_resume_device, FMODE_WRITE,
> +                       NULL);
> +       if (IS_ERR(hib_resume_bdev))
> +               return PTR_ERR(hib_resume_bdev);
>
>         res = set_blocksize(hib_resume_bdev, PAGE_SIZE);
>         if (res < 0)
> --
> 2.28.0
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ