[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAMGffEn--=SspdwND785Y7CcxFZhnf_6f86F50wPgSJUbtuEzA@mail.gmail.com>
Date: Thu, 26 Nov 2020 15:04:29 +0100
From: Jinpu Wang <jinpu.wang@...ud.ionos.com>
To: Wang ShaoBo <bobo.shaobowang@...wei.com>
Cc: Danil Kipnis <danil.kipnis@...ud.ionos.com>,
Jens Axboe <axboe@...nel.dk>,
linux-block <linux-block@...r.kernel.org>,
linux-kernel@...r.kernel.org, huawei.libin@...wei.com,
cj.chengjian@...wei.com
Subject: Re: [PATCH] block/rnbd: server: Fix error return code in rnbd_srv_create_dev_sysfs()
On Wed, Nov 25, 2020 at 1:47 PM Wang ShaoBo <bobo.shaobowang@...wei.com> wrote:
>
> Fix to return -ENOMEM error code from the error handling case where
> kobject_create_and_add() failed instead of 0 in rnbd_srv_create_dev_sysfs(),
> as done elsewhere in this function.
>
> Signed-off-by: Wang ShaoBo <bobo.shaobowang@...wei.com>
Thanks Shaobo, we have a fix for more cases:
https://lore.kernel.org/linux-block/20201126104723.150674-8-jinpu.wang@cloud.ionos.com/T/#u
> ---
> drivers/block/rnbd/rnbd-srv-sysfs.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/block/rnbd/rnbd-srv-sysfs.c b/drivers/block/rnbd/rnbd-srv-sysfs.c
> index 106775c074d1..5ba1a31ad626 100644
> --- a/drivers/block/rnbd/rnbd-srv-sysfs.c
> +++ b/drivers/block/rnbd/rnbd-srv-sysfs.c
> @@ -52,8 +52,10 @@ int rnbd_srv_create_dev_sysfs(struct rnbd_srv_dev *dev,
>
> dev->dev_sessions_kobj = kobject_create_and_add("sessions",
> &dev->dev_kobj);
> - if (!dev->dev_sessions_kobj)
> + if (!dev->dev_sessions_kobj) {
> + ret = -ENOMEM;
> goto put_dev_kobj;
> + }
>
> bdev_kobj = &disk_to_dev(bdev->bd_disk)->kobj;
> ret = sysfs_create_link(&dev->dev_kobj, bdev_kobj, "block_dev");
> --
> 2.17.1
>
Powered by blists - more mailing lists