Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1485746

Re: Question about commit f9a67b1182e5 ("md/bitmap: clear bitmap if bitmap_create failed").

From Guoqing Jiang <gqjiang@suse.com>
Newsgroups linux.kernel
Subject Re: Question about commit f9a67b1182e5 ("md/bitmap: clear bitmap if bitmap_create failed").
Date 2016-09-18 11:30 +0200
Message-ID <siGA9-6ms-3@gated-at.bofh.it> (permalink)
References <sgEVQ-7xR-47@gated-at.bofh.it> <sgZGW-4VC-17@gated-at.bofh.it> <shdJU-6Vq-21@gated-at.bofh.it> <shp8l-5Gc-21@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw



On 09/14/2016 04:39 PM, Marion & Christophe JAILLET wrote:
>
> I don't share your feeling.
> bitmap_create() can return ERR_PTR(-ENOMEM) or ERR_PTR(-EINVAL).
>
> In such cases 'if (!bitmap)' will not be helpful.
>
> Maybe it should be turned into 'if (IS_ERR_OR_NULL(bitmap))' to handle 
> errors returned by bitmap_create.
> Maybe just removing the call to 'bitmap_free(bitmap)' is enough.
>

I agreed we can remove it, if so, seems we are not consistent with the 
previous comment  of bitmap_create.

/*
  * initialize the bitmap structure
  * if this returns an error, bitmap_destroy must be called to do clean up
  */

What about revert it and re-use v1 patch? see 
http://www.spinics.net/lists/raid/msg51819.html.

Thanks,
Guoqing

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Question about commit f9a67b1182e5 ("md/bitmap: clear bitmap if  bitmap_create failed"). Christophe JAILLET <christophe.jaillet@wanadoo.fr> - 2016-09-12 21:20 +0200
  Re: Question about commit f9a67b1182e5 ("md/bitmap: clear bitmap if  bitmap_create failed"). Shaohua Li <shli@kernel.org> - 2016-09-13 19:30 +0200
    Re: Question about commit f9a67b1182e5 ("md/bitmap: clear bitmap if  bitmap_create failed"). Guoqing Jiang <gqjiang@suse.com> - 2016-09-14 10:30 +0200
      Re: Question about commit f9a67b1182e5 ("md/bitmap: clear bitmap if  bitmap_create failed"). Marion & Christophe JAILLET <christophe.jaillet@wanadoo.fr> - 2016-09-14 22:40 +0200
        Re: Question about commit f9a67b1182e5 ("md/bitmap: clear bitmap if  bitmap_create failed"). Guoqing Jiang <gqjiang@suse.com> - 2016-09-18 11:30 +0200

csiph-web