Linux-Block Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH 0/2] bcache patches for Linux v5.13 - 3rd wave
@ 2021-04-20  4:44 Coly Li
  2021-04-20  4:44 ` [PATCH 1/2] bcache: Kconfig dependence fix for NVDIMM support Coly Li
  2021-04-20  4:44 ` [PATCH 2/2] bcache: Set error return err to -ENOMEM on allocation failure Coly Li
  0 siblings, 2 replies; 4+ messages in thread
From: Coly Li @ 2021-04-20  4:44 UTC (permalink / raw)
  To: axboe; +Cc: linux-bcache, linux-block, Coly Li

HI Jens,

Here are the current bcache fixes for already merged patches in
linux-next for Linux v5.13. 

Thank you in advance for taking them.

Coly Li
---

Colin Ian King (1):
  bcache: Set error return err to -ENOMEM on allocation failure

Coly Li (1):
  bcache: Kconfig dependence fix for NVDIMM support

 drivers/md/bcache/Kconfig     | 4 ++--
 drivers/md/bcache/nvm-pages.c | 1 +
 2 files changed, 3 insertions(+), 2 deletions(-)

-- 
2.26.2


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/2] bcache: Kconfig dependence fix for NVDIMM support
  2021-04-20  4:44 [PATCH 0/2] bcache patches for Linux v5.13 - 3rd wave Coly Li
@ 2021-04-20  4:44 ` Coly Li
  2021-04-20  5:36   ` Randy Dunlap
  2021-04-20  4:44 ` [PATCH 2/2] bcache: Set error return err to -ENOMEM on allocation failure Coly Li
  1 sibling, 1 reply; 4+ messages in thread
From: Coly Li @ 2021-04-20  4:44 UTC (permalink / raw)
  To: axboe; +Cc: linux-bcache, linux-block, Coly Li, Randy Dunlap

In drivers/md/bcache/Kconfig, setting BCACHE_NVM_PAGES to "selected"
LIBNVDIMM and DAX is improper. This patch changes to Kconfig dependance
from "selected" to "depends on" for LIBNVDIMM and DAX.

Reported-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Coly Li <colyli@suse.de>
---
 drivers/md/bcache/Kconfig | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/md/bcache/Kconfig b/drivers/md/bcache/Kconfig
index 0996e366ad0b..59999f24d89e 100644
--- a/drivers/md/bcache/Kconfig
+++ b/drivers/md/bcache/Kconfig
@@ -40,7 +40,7 @@ config BCACHE_NVM_PAGES
 	bool "NVDIMM support for bcache (EXPERIMENTAL)"
 	depends on BCACHE
 	depends on PHYS_ADDR_T_64BIT
-	select LIBNVDIMM
-	select DAX
+	depends on LIBNVDIMM
+	depends on DAX
 	help
 	nvm pages allocator for bcache.
-- 
2.26.2


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 2/2] bcache: Set error return err to -ENOMEM on allocation failure
  2021-04-20  4:44 [PATCH 0/2] bcache patches for Linux v5.13 - 3rd wave Coly Li
  2021-04-20  4:44 ` [PATCH 1/2] bcache: Kconfig dependence fix for NVDIMM support Coly Li
@ 2021-04-20  4:44 ` Coly Li
  1 sibling, 0 replies; 4+ messages in thread
From: Coly Li @ 2021-04-20  4:44 UTC (permalink / raw)
  To: axboe; +Cc: linux-bcache, linux-block, Colin Ian King, Coly Li

From: Colin Ian King <colin.king@canonical.com>

Currently when ns fails to be allocated the error return path returns
an uninitialized return code in variable 'err'. Fix this by setting
err to -ENOMEM.

Addresses-Coverity: ("Uninitialized scalar variable")
Fixes: 688330711e9a ("bcache: initialize the nvm pages allocator")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Coly Li <colyli@suse.de>
---
 drivers/md/bcache/nvm-pages.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/md/bcache/nvm-pages.c b/drivers/md/bcache/nvm-pages.c
index 08cd45e90481..2e124d546099 100644
--- a/drivers/md/bcache/nvm-pages.c
+++ b/drivers/md/bcache/nvm-pages.c
@@ -584,6 +584,7 @@ struct bch_nvm_namespace *bch_register_namespace(const char *dev_path)
 		return ERR_PTR(PTR_ERR(bdev));
 	}
 
+	err = -ENOMEM;
 	ns = kzalloc(sizeof(struct bch_nvm_namespace), GFP_KERNEL);
 	if (!ns)
 		goto bdput;
-- 
2.26.2


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] bcache: Kconfig dependence fix for NVDIMM support
  2021-04-20  4:44 ` [PATCH 1/2] bcache: Kconfig dependence fix for NVDIMM support Coly Li
@ 2021-04-20  5:36   ` Randy Dunlap
  0 siblings, 0 replies; 4+ messages in thread
From: Randy Dunlap @ 2021-04-20  5:36 UTC (permalink / raw)
  To: Coly Li, axboe; +Cc: linux-bcache, linux-block

On 4/19/21 9:44 PM, Coly Li wrote:
> In drivers/md/bcache/Kconfig, setting BCACHE_NVM_PAGES to "selected"
> LIBNVDIMM and DAX is improper. This patch changes to Kconfig dependance
> from "selected" to "depends on" for LIBNVDIMM and DAX.
> 
> Reported-by: Randy Dunlap <rdunlap@infradead.org>
> Cc: Jens Axboe <axboe@kernel.dk>
> Signed-off-by: Coly Li <colyli@suse.de>

Acked-by: Randy Dunlap <rdunlap@infradead.org> # build-tested


Thanks.

> ---
>  drivers/md/bcache/Kconfig | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/md/bcache/Kconfig b/drivers/md/bcache/Kconfig
> index 0996e366ad0b..59999f24d89e 100644
> --- a/drivers/md/bcache/Kconfig
> +++ b/drivers/md/bcache/Kconfig
> @@ -40,7 +40,7 @@ config BCACHE_NVM_PAGES
>  	bool "NVDIMM support for bcache (EXPERIMENTAL)"
>  	depends on BCACHE
>  	depends on PHYS_ADDR_T_64BIT
> -	select LIBNVDIMM
> -	select DAX
> +	depends on LIBNVDIMM
> +	depends on DAX
>  	help
>  	nvm pages allocator for bcache.
> 


-- 
~Randy


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, back to index

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-20  4:44 [PATCH 0/2] bcache patches for Linux v5.13 - 3rd wave Coly Li
2021-04-20  4:44 ` [PATCH 1/2] bcache: Kconfig dependence fix for NVDIMM support Coly Li
2021-04-20  5:36   ` Randy Dunlap
2021-04-20  4:44 ` [PATCH 2/2] bcache: Set error return err to -ENOMEM on allocation failure Coly Li

Linux-Block Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-block/0 linux-block/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-block linux-block/ https://lore.kernel.org/linux-block \
		linux-block@vger.kernel.org
	public-inbox-index linux-block

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-block


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git