All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Williams <dan.j.williams@intel.com>
To: "Elliott, Robert (Server Storage)" <Elliott@hp.com>
Cc: "axboe@kernel.dk" <axboe@kernel.dk>,
	"linux-nvdimm@lists.01.org" <linux-nvdimm@lists.01.org>,
	"neilb@suse.de" <neilb@suse.de>,
	"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"hch@lst.de" <hch@lst.de>,
	"linux-acpi@vger.kernel.org" <linux-acpi@vger.kernel.org>,
	"mingo@kernel.org" <mingo@kernel.org>
Subject: Re: [PATCH v3 14/21] libnd: blk labels and namespace instantiation
Date: Fri, 22 May 2015 11:51:18 -0700	[thread overview]
Message-ID: <CAPcyv4jrxUjqKygB1zcJTELMmL+fxFHrnttW31H41O=owGSwgw@mail.gmail.com> (raw)
In-Reply-To: <94D0CD8314A33A4D9D801C0FE68B40295A91FBF3@G9W0745.americas.hpqcorp.net>

On Fri, May 22, 2015 at 11:37 AM, Elliott, Robert (Server Storage)
<Elliott@hp.com> wrote:
>
>> -----Original Message-----
>> From: Linux-nvdimm [mailto:linux-nvdimm-bounces@lists.01.org] On Behalf Of
>> Dan Williams
>> Sent: Wednesday, May 20, 2015 3:57 PM
>> To: axboe@kernel.dk
>> Cc: linux-nvdimm@lists.01.org; neilb@suse.de; gregkh@linuxfoundation.org;
>> linux-kernel@vger.kernel.org; hch@lst.de; linux-acpi@vger.kernel.org;
>> mingo@kernel.org
>> Subject: [PATCH v3 14/21] libnd: blk labels and namespace instantiation
>>
> ...
>> @@ -1029,6 +1244,173 @@ static struct device **create_namespace_pmem(struct
>> nd_region *nd_region)
>>       return NULL;
>>  }
>>
>> +struct resource *nsblk_add_resource(struct nd_region *nd_region,
>> +             struct nd_dimm_drvdata *ndd, struct nd_namespace_blk *nsblk,
>> +             resource_size_t start)
>> +{
>> +     struct nd_label_id label_id;
>> +     struct resource *res;
>> +
>> +     nd_label_gen_id(&label_id, nsblk->uuid, NSLABEL_FLAG_LOCAL);
>> +     nsblk->res = krealloc(nsblk->res,
>> +                     sizeof(void *) * (nsblk->num_resources + 1),
>> +                     GFP_KERNEL);
>> +     if (!nsblk->res)
>> +             return NULL;
>
> scripts/checkpatch.pl doesn't like that:
> WARNING: Reusing the krealloc arg is almost always a bug
> #1411: FILE: drivers/block/nd/namespace_devs.c:1411:
> +       nsblk->res = krealloc(nsblk->res,
>
> The reasoning (https://lkml.org/lkml/2013/3/14/558) is:
>
> "If krealloc() returns NULL, it *doesn't* free the original. So any
> code of the form 'foo = krealloc(foo, …);' is almost certainly a bug."
>

Ok, will fix that up.

WARNING: multiple messages have this Message-ID (diff)
From: Dan Williams <dan.j.williams@intel.com>
To: "Elliott, Robert (Server Storage)" <Elliott@hp.com>
Cc: "axboe@kernel.dk" <axboe@kernel.dk>,
	"linux-nvdimm@lists.01.org" <linux-nvdimm@ml01.01.org>,
	"neilb@suse.de" <neilb@suse.de>,
	"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"hch@lst.de" <hch@lst.de>,
	"linux-acpi@vger.kernel.org" <linux-acpi@vger.kernel.org>,
	"mingo@kernel.org" <mingo@kernel.org>
Subject: Re: [PATCH v3 14/21] libnd: blk labels and namespace instantiation
Date: Fri, 22 May 2015 11:51:18 -0700	[thread overview]
Message-ID: <CAPcyv4jrxUjqKygB1zcJTELMmL+fxFHrnttW31H41O=owGSwgw@mail.gmail.com> (raw)
In-Reply-To: <94D0CD8314A33A4D9D801C0FE68B40295A91FBF3@G9W0745.americas.hpqcorp.net>

On Fri, May 22, 2015 at 11:37 AM, Elliott, Robert (Server Storage)
<Elliott@hp.com> wrote:
>
>> -----Original Message-----
>> From: Linux-nvdimm [mailto:linux-nvdimm-bounces@lists.01.org] On Behalf Of
>> Dan Williams
>> Sent: Wednesday, May 20, 2015 3:57 PM
>> To: axboe@kernel.dk
>> Cc: linux-nvdimm@lists.01.org; neilb@suse.de; gregkh@linuxfoundation.org;
>> linux-kernel@vger.kernel.org; hch@lst.de; linux-acpi@vger.kernel.org;
>> mingo@kernel.org
>> Subject: [PATCH v3 14/21] libnd: blk labels and namespace instantiation
>>
> ...
>> @@ -1029,6 +1244,173 @@ static struct device **create_namespace_pmem(struct
>> nd_region *nd_region)
>>       return NULL;
>>  }
>>
>> +struct resource *nsblk_add_resource(struct nd_region *nd_region,
>> +             struct nd_dimm_drvdata *ndd, struct nd_namespace_blk *nsblk,
>> +             resource_size_t start)
>> +{
>> +     struct nd_label_id label_id;
>> +     struct resource *res;
>> +
>> +     nd_label_gen_id(&label_id, nsblk->uuid, NSLABEL_FLAG_LOCAL);
>> +     nsblk->res = krealloc(nsblk->res,
>> +                     sizeof(void *) * (nsblk->num_resources + 1),
>> +                     GFP_KERNEL);
>> +     if (!nsblk->res)
>> +             return NULL;
>
> scripts/checkpatch.pl doesn't like that:
> WARNING: Reusing the krealloc arg is almost always a bug
> #1411: FILE: drivers/block/nd/namespace_devs.c:1411:
> +       nsblk->res = krealloc(nsblk->res,
>
> The reasoning (https://lkml.org/lkml/2013/3/14/558) is:
>
> "If krealloc() returns NULL, it *doesn't* free the original. So any
> code of the form 'foo = krealloc(foo, …);' is almost certainly a bug."
>

Ok, will fix that up.

  reply	other threads:[~2015-05-22 18:51 UTC|newest]

Thread overview: 89+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-20 20:56 [PATCH v3 00/21] libnd: non-volatile memory device support Dan Williams
2015-05-20 20:56 ` Dan Williams
2015-05-20 20:56 ` [PATCH v3 01/21] e820, efi: add ACPI 6.0 persistent memory types Dan Williams
2015-05-20 20:56   ` Dan Williams
2015-05-20 20:56 ` [PATCH v3 02/21] libnd, nfit: initial libnd infrastructure and NFIT support Dan Williams
2015-05-20 20:56   ` Dan Williams
2015-05-21 13:55   ` Toshi Kani
2015-05-21 13:55     ` Toshi Kani
2015-05-21 15:56     ` Dan Williams
2015-05-21 15:56       ` Dan Williams
2015-05-21 17:25       ` Toshi Kani
2015-05-21 17:25         ` Toshi Kani
2015-05-21 17:49         ` Moore, Robert
2015-05-21 17:49           ` Moore, Robert
2015-05-21 18:01           ` Toshi Kani
2015-05-21 18:01             ` Toshi Kani
2015-05-21 19:06             ` Dan Williams
2015-05-21 19:06               ` Dan Williams
2015-05-21 19:44               ` Toshi Kani
2015-05-21 19:44                 ` Toshi Kani
2015-05-21 19:44                 ` Toshi Kani
2015-05-21 19:59                 ` Toshi Kani
2015-05-21 19:59                   ` Toshi Kani
2015-05-21 19:59                   ` Toshi Kani
2015-05-21 20:59                   ` Linda Knippers
2015-05-21 20:59                     ` Linda Knippers
2015-05-21 20:59                     ` Linda Knippers
2015-05-21 21:34                     ` Dan Williams
2015-05-21 21:34                       ` Dan Williams
2015-05-21 21:34                       ` Dan Williams
2015-05-21 22:11                       ` Toshi Kani
2015-05-21 22:11                         ` Toshi Kani
2015-05-22 14:58                       ` Moore, Robert
2015-05-22 14:58                         ` Moore, Robert
2015-05-22 15:21                         ` Toshi Kani
2015-05-22 15:21                           ` Toshi Kani
2015-05-22 16:12                           ` Moore, Robert
2015-05-22 16:12                             ` Moore, Robert
2015-05-20 20:56 ` [PATCH v3 03/21] libnd: control character device and libnd bus sysfs attributes Dan Williams
2015-05-20 20:56   ` Dan Williams
2015-05-20 20:56 ` [PATCH v3 04/21] libnd, nfit: dimm/memory-devices Dan Williams
2015-05-20 20:56   ` Dan Williams
2015-05-20 20:56 ` [PATCH v3 05/21] libnd: control (ioctl) messages for libnd bus and dimm devices Dan Williams
2015-05-20 20:56   ` Dan Williams
2015-05-20 20:56 ` [PATCH v3 06/21] libnd, nd_dimm: dimm driver and base libnd device-driver infrastructure Dan Williams
2015-05-20 20:56   ` Dan Williams
2015-05-20 20:56 ` [PATCH v3 07/21] libnd, nfit: regions (block-data-window, persistent memory, volatile memory) Dan Williams
2015-05-20 20:56   ` Dan Williams
2015-05-20 20:56 ` [PATCH v3 08/21] libnd: support for legacy (non-aliasing) nvdimms Dan Williams
2015-05-20 20:56   ` Dan Williams
2015-05-20 20:57 ` [PATCH v3 09/21] libnd, nd_pmem: add libnd support to the pmem driver Dan Williams
2015-05-20 20:57   ` Dan Williams
2015-05-23 14:39   ` Christoph Hellwig
2015-05-23 16:59     ` Dan Williams
2015-05-20 20:57 ` [PATCH v3 10/21] pmem: Dynamically allocate partition numbers Dan Williams
2015-05-20 20:57   ` Dan Williams
2015-05-20 20:57 ` [PATCH v3 11/21] libnd, nfit: add interleave-set state-tracking infrastructure Dan Williams
2015-05-20 20:57   ` Dan Williams
2015-05-20 20:57 ` [PATCH v3 12/21] libnd: namespace indices: read and validate Dan Williams
2015-05-20 20:57   ` Dan Williams
2015-05-20 20:57 ` [PATCH v3 13/21] libnd: pmem label sets and namespace instantiation Dan Williams
2015-05-20 20:57   ` Dan Williams
2015-05-20 20:57 ` [PATCH v3 14/21] libnd: blk labels " Dan Williams
2015-05-20 20:57   ` Dan Williams
2015-05-22 18:37   ` Elliott, Robert (Server Storage)
2015-05-22 18:37     ` Elliott, Robert (Server Storage)
2015-05-22 18:37     ` Elliott, Robert (Server Storage)
2015-05-22 18:51     ` Dan Williams [this message]
2015-05-22 18:51       ` Dan Williams
2015-05-20 20:57 ` [PATCH v3 15/21] libnd: write pmem label set Dan Williams
2015-05-20 20:57   ` Dan Williams
2015-05-20 20:57 ` [PATCH v3 16/21] libnd: write blk " Dan Williams
2015-05-20 20:57   ` Dan Williams
2015-05-20 20:57 ` [PATCH v3 17/21] libnd: infrastructure for btt devices Dan Williams
2015-05-20 20:57   ` Dan Williams
2015-05-20 20:57 ` [PATCH v3 18/21] nd_btt: atomic sector updates Dan Williams
2015-05-20 20:57   ` Dan Williams
2015-05-22 21:16   ` Elliott, Robert (Server Storage)
2015-05-22 21:16     ` Elliott, Robert (Server Storage)
2015-05-22 21:39     ` Dan Williams
2015-05-22 21:39       ` Dan Williams
2015-05-20 20:57 ` [PATCH v3 19/21] libnd, nfit, nd_blk: driver for BLK-mode access persistent memory Dan Williams
2015-05-20 20:57   ` Dan Williams
2015-05-20 20:58 ` [PATCH v3 20/21] nfit-test: manufactured NFITs for interface development Dan Williams
2015-05-20 20:58   ` Dan Williams
2015-05-25  7:02   ` Elliott, Robert (Server Storage)
2015-05-25  7:02     ` Elliott, Robert (Server Storage)
2015-05-20 20:58 ` [PATCH v3 21/21] libnd: Non-Volatile Devices Dan Williams
2015-05-20 20:58   ` Dan Williams

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAPcyv4jrxUjqKygB1zcJTELMmL+fxFHrnttW31H41O=owGSwgw@mail.gmail.com' \
    --to=dan.j.williams@intel.com \
    --cc=Elliott@hp.com \
    --cc=axboe@kernel.dk \
    --cc=gregkh@linuxfoundation.org \
    --cc=hch@lst.de \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nvdimm@lists.01.org \
    --cc=mingo@kernel.org \
    --cc=neilb@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.