dm-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: damien.lemoal@wdc.com
Cc: dm-devel@redhat.com
Subject: Re: [dm-devel] [bug report] dm: introduce zone append emulation
Date: Fri, 18 Jun 2021 15:24:17 +0300	[thread overview]
Message-ID: <20210618122417.GZ1901@kadam> (raw)
In-Reply-To: <YMyP68Q7tNnn+ZpQ@mwanda>

On Fri, Jun 18, 2021 at 03:22:03PM +0300, Dan Carpenter wrote:
> Hello Damien Le Moal,
> 
> The patch bb37d77239af: "dm: introduce zone append emulation" from
> May 26, 2021, leads to the following static checker warning:
> 
> 	drivers/md/dm-zone.c:207 dm_zone_revalidate_cb()
> 	error: kvmalloc() only makes sense with GFP_KERNEL
> 
> drivers/md/dm-zone.c
>    179  static int dm_zone_revalidate_cb(struct blk_zone *zone, unsigned int idx,
>    180                                   void *data)
>    181  {
>    182          struct mapped_device *md = data;
>    183          struct request_queue *q = md->queue;
>    184  
>    185          switch (zone->type) {
>    186          case BLK_ZONE_TYPE_CONVENTIONAL:
>    187                  if (!q->conv_zones_bitmap) {
>    188                          q->conv_zones_bitmap =
>    189                                  kcalloc(BITS_TO_LONGS(q->nr_zones),
>    190                                          sizeof(unsigned long), GFP_NOIO);
>    191                          if (!q->conv_zones_bitmap)
>    192                                  return -ENOMEM;
>    193                  }
>    194                  set_bit(idx, q->conv_zones_bitmap);
>    195                  break;
>    196          case BLK_ZONE_TYPE_SEQWRITE_REQ:
>    197          case BLK_ZONE_TYPE_SEQWRITE_PREF:
>    198                  if (!q->seq_zones_wlock) {
>    199                          q->seq_zones_wlock =
>    200                                  kcalloc(BITS_TO_LONGS(q->nr_zones),
>    201                                          sizeof(unsigned long), GFP_NOIO);
>    202                          if (!q->seq_zones_wlock)
>    203                                  return -ENOMEM;
>    204                  }
>    205                  if (!md->zwp_offset) {
>    206                          md->zwp_offset =
>    207                                  kvcalloc(q->nr_zones, sizeof(unsigned int),
>    208                                           GFP_NOIO);
> 
> kvcalloc() does not respect the GFP_NOIO flag.
> 

Ugh, what I meant was kvcalloc() with the GFP_NOIO flag is the same as
calling kcalloc(), it won't vmalloc() the memory.

regards,
dan carpenter

--
dm-devel mailing list
dm-devel@redhat.com
https://listman.redhat.com/mailman/listinfo/dm-devel


      reply	other threads:[~2021-06-18 12:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-18 12:22 [dm-devel] [bug report] dm: introduce zone append emulation Dan Carpenter
2021-06-18 12:24 ` Dan Carpenter [this message]

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=20210618122417.GZ1901@kadam \
    --to=dan.carpenter@oracle.com \
    --cc=damien.lemoal@wdc.com \
    --cc=dm-devel@redhat.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).