From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mail-yx0-f177.google.com ([209.85.213.177]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1Sa4m6-0005ms-5Z for barebox@lists.infradead.org; Thu, 31 May 2012 12:46:46 +0000 Received: by yenr9 with SMTP id r9so847714yen.36 for ; Thu, 31 May 2012 05:46:45 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <1338355875-18830-2-git-send-email-s.hauer@pengutronix.de> References: <1338355875-18830-1-git-send-email-s.hauer@pengutronix.de> <1338355875-18830-2-git-send-email-s.hauer@pengutronix.de> From: Roberto Nibali Date: Thu, 31 May 2012 14:46:24 +0200 Message-ID: List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: multipart/mixed; boundary="===============1066204641177313092==" Sender: barebox-bounces@lists.infradead.org Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: Re: [PATCH 2/2] block: do not BUG() on failed block_get To: Sascha Hauer Cc: barebox@lists.infradead.org --===============1066204641177313092== Content-Type: multipart/alternative; boundary=e89a8f3bac1fd03f9704c1547539 --e89a8f3bac1fd03f9704c1547539 Content-Type: text/plain; charset=ISO-8859-1 Hi On Wed, May 30, 2012 at 7:31 AM, Sascha Hauer wrote: > It does not necessarily means a bug when block_get fails here, > this can also be a failure on the underlying device. > > Signed-off-by: Sascha Hauer > --- > common/block.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/common/block.c b/common/block.c > index 437dc95..5983171 100644 > --- a/common/block.c > +++ b/common/block.c > @@ -245,7 +245,7 @@ static int block_put(struct block_device *blk, const > void *buf, int block) > > data = block_get(blk, block); > if (IS_ERR(data)) > - BUG(); > + return PTR_ERR(data); > > memcpy(data, buf, 1 << blk->blockbits); > > -- > 1.7.10 > > Tested-by: Roberto Nibali Acked-by: Roberto Nibali --e89a8f3bac1fd03f9704c1547539 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi

On Wed, May 30, 2012 at 7:31 AM, Sasch= a Hauer <s.hauer@pengutronix.de> wrote:
It does not necessarily means a bug when block_get fails here,
this can also be a failure on the underlying device.

Signed-off-by: Sascha Hauer <s= .hauer@pengutronix.de>
---
=A0common/block.c | =A0 =A02 +-
=A01 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/block.c b/common/block.c
index 437dc95..5983171 100644
--- a/common/block.c
+++ b/common/block.c
@@ -245,7 +245,7 @@ static int block_put(struct block_device *blk, const vo= id *buf, int block)

=A0 =A0 =A0 =A0data =3D block_get(blk, block);
=A0 =A0 =A0 =A0if (IS_ERR(data))
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 BUG();
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 return PTR_ERR(data);

=A0 =A0 =A0 =A0memcpy(data, buf, 1 << blk->blockbits);

--
1.7.10


Tested-by: Roberto Nibal= i <rnibali@gmail.com>
<= div>Acked-by: Roberto Nibali <rniba= li@gmail.com>

=A0

--e89a8f3bac1fd03f9704c1547539-- --===============1066204641177313092== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox --===============1066204641177313092==--