linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] dm bufio: Fix error code in dm_bufio_write_dirty_buffers()
@ 2017-07-12  7:26 Dan Carpenter
  2017-07-12  7:30 ` Christoph Hellwig
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2017-07-12  7:26 UTC (permalink / raw)
  To: Alasdair Kergon, Christoph Hellwig
  Cc: Mike Snitzer, dm-devel, Shaohua Li, linux-raid, kernel-janitors

We should be returning normal negative error codes here.  The "a"
variables comes from &c->async_write_error which is a blk_status_t
converted to a regular error code.

In the current code, the blk_status_t gets propogated back to
pool_create() and eventually results in an Oops.

Fixes: 4e4cbee93d56 ("block: switch bios to blk_status_t")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/md/dm-bufio.c b/drivers/md/dm-bufio.c
index 850ff6c67994..44f4a8ac95bd 100644
--- a/drivers/md/dm-bufio.c
+++ b/drivers/md/dm-bufio.c
@@ -1258,8 +1258,7 @@ EXPORT_SYMBOL_GPL(dm_bufio_write_dirty_buffers_async);
  */
 int dm_bufio_write_dirty_buffers(struct dm_bufio_client *c)
 {
-	blk_status_t a;
-	int f;
+	int a, f;
 	unsigned long buffers_processed = 0;
 	struct dm_buffer *b, *tmp;
 

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

* Re: [PATCH] dm bufio: Fix error code in dm_bufio_write_dirty_buffers()
  2017-07-12  7:26 [PATCH] dm bufio: Fix error code in dm_bufio_write_dirty_buffers() Dan Carpenter
@ 2017-07-12  7:30 ` Christoph Hellwig
  0 siblings, 0 replies; 2+ messages in thread
From: Christoph Hellwig @ 2017-07-12  7:30 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Alasdair Kergon, Christoph Hellwig, Mike Snitzer, dm-devel,
	Shaohua Li, linux-raid, kernel-janitors

On Wed, Jul 12, 2017 at 10:26:34AM +0300, Dan Carpenter wrote:
> We should be returning normal negative error codes here.  The "a"
> variables comes from &c->async_write_error which is a blk_status_t
> converted to a regular error code.
> 
> In the current code, the blk_status_t gets propogated back to
> pool_create() and eventually results in an Oops.

And sparse correctly warns about this, so no idea how this slipped in..

> 
> Fixes: 4e4cbee93d56 ("block: switch bios to blk_status_t")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Reviewed-by: Christoph Hellwig <hch@lst.de>

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

end of thread, other threads:[~2017-07-12  7:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-12  7:26 [PATCH] dm bufio: Fix error code in dm_bufio_write_dirty_buffers() Dan Carpenter
2017-07-12  7:30 ` Christoph Hellwig

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).