Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp571943pxu; Thu, 26 Nov 2020 06:08:03 -0800 (PST) X-Google-Smtp-Source: ABdhPJwQNuO3KXEmvLfBcgnC1VEnJyY/xmo3NgC3jbgSpU87N2SYYiU185Jp+aLFvNV/iLP4VlW7 X-Received: by 2002:a17:906:2b81:: with SMTP id m1mr2894401ejg.251.1606399683157; Thu, 26 Nov 2020 06:08:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606399683; cv=none; d=google.com; s=arc-20160816; b=OY+bKGq25hD6hzomaOsH7SnGyDW3r2lGoe606K1LnJtHU2jq72nFtZ8vnhaY0EP6En XgXZCACMgghscqvai/zYMpuKmTJuaUiY0l253S3n3RSX5rw9hJ7CHcFIAYH81rVWtza+ eRVhvMeN7wz6EwoDTz5Bk89wefzycZcTjpMTvfHz5h36hGVZvJgLu8BS4AfXf93lpzcU VT2FJh6J75hHBk3dJ/9KKWL0+arMtfxIUXy2PgO/DwwNMJSPV/2CppAQz4cpNlxh02m6 ZHdYtw4ub0vaZKg11qWqGGC03NQxk5DJwzDfTd8ze4JYrhfnVSghsRORyttILtUNw1qd c72g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=2msFitdz7jneyi5nHmujXpbaLFZfcSY4FLaJaH2640k=; b=sIfoBJLFeGfA33LEtK+nISVNggRCjCxkvgnE4Kyi45srkTeHF9mtfROj2NbYIu6k59 AzZIsranCTt/mDGdrk0OpG94dCahoejuubyMbsbbqBYZwfNt8A2Q8H0yXMXYXuXXRf3v as7JMSd7nkDVSI/atbzSEAWyJYsyEu9MNQd8+bzjVZPwsqsAW/Bdl+JZNcoK2I22o47Q 0zugn4K1BCBTOBUXRS3iDZ3H3nPG6IgFTBSeaB987200MPXBHzW2zZIFhgrfQmGLGMkp Z433+9/lQHaTaSX3sAdwbZ+4/l9jQDw0KC8UTJ/r5wCeC/F8geVk5YMBVK9XvrxE5fnj dcAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cloud.ionos.com header.s=google header.b=D1LbUTmP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ionos.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id qt10si3488865ejb.44.2020.11.26.06.07.36; Thu, 26 Nov 2020 06:08:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@cloud.ionos.com header.s=google header.b=D1LbUTmP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ionos.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389944AbgKZOEl (ORCPT + 99 others); Thu, 26 Nov 2020 09:04:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34060 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389847AbgKZOEl (ORCPT ); Thu, 26 Nov 2020 09:04:41 -0500 Received: from mail-ed1-x542.google.com (mail-ed1-x542.google.com [IPv6:2a00:1450:4864:20::542]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2E088C0613D4 for ; Thu, 26 Nov 2020 06:04:41 -0800 (PST) Received: by mail-ed1-x542.google.com with SMTP id k4so2448887edl.0 for ; Thu, 26 Nov 2020 06:04:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cloud.ionos.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=2msFitdz7jneyi5nHmujXpbaLFZfcSY4FLaJaH2640k=; b=D1LbUTmPTvKUgRmGIV/rJfCW0JlkVcwSY4SyBOipgdzYjUKMiOTSf8irLD4IA8Ym9n qfZlNZm8eUzJuFd//Swf+63RvVTsiDA9WnIfFXium5KpySlYdiwpvovai1mydjKR6ZM8 ly6NiQzxpYPweX4AoYLMbCyqikWGG5/VALPox3MxPiDzuIsyEqEJd8NCWcamyRPzFp/i ICV0TU/mX7bFeImElF0Ax7JdPQpoDGEclt0eIIyuAkMZa6+zLvoHwxIwTf02Lfr4V2ys QTovNLhRVJjAv4Lo6AFZr99zsmGzQxvGSc9kHbWyV2OzrFCr+94Wn4eDEFncRbRJxH1O PLoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=2msFitdz7jneyi5nHmujXpbaLFZfcSY4FLaJaH2640k=; b=sgFVFA1hUtJsW7reVNfIS1gbY3HzorfISpHLfLPU23laZtPcjBU/ybjhTugg7rPco7 JMqLPn2NHtuPBD7CisSdogJpHeKmsoUyEGGj2bQcQh554pMd+tuQs3DP/QIsHFsCQnpm 2sg0bkx2kJ0NEWBn4tS1/n5fLrez2+pvtm0p+VFKPfiSS2bsO6VuIeNK8UB1qkxlt6I+ g96TK36SibZvFtVcw3g12pgkhPxtFmTbB0oomdksgcAnQz7lt0wSiYuvIEAq2TV1Ye06 tY3BdyIF6uCkYjZJOfUGvcVw8BTDBJZnCXxIEenc1JwwNpgbq0zS6Hy95MUKRkynjh1S k4ow== X-Gm-Message-State: AOAM531ghknPT9DYLh43hMAgYoBjbtC0FqYvfl94i9xFoknz43fHZhdS JxEAgumlObxYHyIq0gqsZmukmC8uB6PkwE8UXpB+UA== X-Received: by 2002:a50:c30d:: with SMTP id a13mr2658012edb.89.1606399479885; Thu, 26 Nov 2020 06:04:39 -0800 (PST) MIME-Version: 1.0 References: <20201125124647.30327-1-bobo.shaobowang@huawei.com> In-Reply-To: <20201125124647.30327-1-bobo.shaobowang@huawei.com> From: Jinpu Wang Date: Thu, 26 Nov 2020 15:04:29 +0100 Message-ID: Subject: Re: [PATCH] block/rnbd: server: Fix error return code in rnbd_srv_create_dev_sysfs() To: Wang ShaoBo Cc: Danil Kipnis , Jens Axboe , linux-block , linux-kernel@vger.kernel.org, huawei.libin@huawei.com, cj.chengjian@huawei.com Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Nov 25, 2020 at 1:47 PM Wang ShaoBo 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 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 >