lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 20 Nov 2012 09:18:24 +1100
From:	NeilBrown <neilb@...e.de>
To:	Dan Williams <djbw@...com>
Cc:	Bartlomiej Zolnierkiewicz <b.zolnierkie@...sung.com>,
	Alan Cox <alan@...rguk.ukuu.org.uk>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"linux-raid@...r.kernel.org" <linux-raid@...r.kernel.org>,
	Vinod Koul <vinod.koul@...el.com>,
	Tomasz Figa <t.figa@...sung.com>,
	Kyungmin Park <kyungmin.park@...sung.com>
Subject: Re: [PATCH] raid5: panic() on dma_wait_for_async_tx() error

On Mon, 19 Nov 2012 05:22:25 +0000 Dan Williams <djbw@...com> wrote:

> 
> 
> On 11/18/12 5:06 PM, "NeilBrown" <neilb@...e.de> wrote:
> 
> >
> >Hi Dan,
> > could you comment on this please?  Would it make sense to arrange for
> >errors
> > to propagate up?  Or should we arrange to do a software-fallback in the
> >dma
> > engine is a problem?  What sort of things can cause error here anyway?
> 
> Propagating up is missing reliable "dma abort" operation.
> 
> In these cases the engine failed to complete due to hardware hang / driver
> bug, or has hit a memory error (uncorrectable even with software
> fallback).  This originally should have been using async_tx_quiesce()
> which also does the panic.
> 
> The engines that I have worked with have either lacked support for
> aborting, or were otherwise unable to recover from a hardware hang.
> However, for engines that do support error recovery they should be able to
> hide the failure from the upper layers.
>

So maybe I could:

diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index ac09fa4..ffbf0ca 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -3268,7 +3268,7 @@ static void handle_stripe_expansion(struct r5conf *conf, struct stripe_head *sh)
 	/* done submitting copies, wait for them to complete */
 	if (tx) {
 		async_tx_ack(tx);
-		dma_wait_for_async_tx(tx);
+		async_tx_quiesce(&tx);
 	}
 }
 


and then the panic would be somebody else's problem?

I note that handle_stripe_expansion has:

 		async_tx_ack(tx);
		dma_wait_for_async_tx(tx);

while async_tx_quiesce() has:

		if (dma_wait_for_async_tx(*tx) == DMA_ERROR)
			panic("DMA_ERROR waiting for transaction\n");
		async_tx_ack(*tx);


i.e. the same two functions called in the reverse order.  Is the order
important?  Is handle_stripe_expansion wrong?   Should the patch I apply
actually be:


diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index ac09fa4..e51d903 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -3266,10 +3266,7 @@ static void handle_stripe_expansion(struct r5conf *conf, struct stripe_head *sh)
 
 		}
 	/* done submitting copies, wait for them to complete */
-	if (tx) {
-		async_tx_ack(tx);
-		dma_wait_for_async_tx(tx);
-	}
+	async_tx_quiesce(&tx);
 }
 
 /*


because async_tx_quiesce() does the NULL test too???

Thanks,
NeilBrown


Download attachment "signature.asc" of type "application/pgp-signature" (829 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ