linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* nbd: clean up error handling
@ 2008-12-18 18:21 Pavel Machek
  2008-12-18 19:15 ` Paul Clements
  0 siblings, 1 reply; 3+ messages in thread
From: Pavel Machek @ 2008-12-18 18:21 UTC (permalink / raw)
  To: Paul.Clements, kernel list, Andrew Morton

Uses existing error_out: label instead of hardcoding error action.

Signed-off-by: Pavel Machek <pavel@suse.cz>

---
commit d4bf0663fe12e5536360b2b9a3df3f49cdb7ef76
tree b5b88ccf8008e135a972415f186b8a93cecb184c
parent 70b683565a6bfdb95a367b47509c2bc5db54c33f
author Pavel <pavel@amd.ucw.cz> Thu, 18 Dec 2008 19:20:21 +0100
committer Pavel <pavel@amd.ucw.cz> Thu, 18 Dec 2008 19:20:21 +0100

 drivers/block/nbd.c |    9 +++------
 1 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c
index d3a91ca..f0b8ee2 100644
--- a/drivers/block/nbd.c
+++ b/drivers/block/nbd.c
@@ -465,9 +465,7 @@ static void nbd_handle_req(struct nbd_de
 		mutex_unlock(&lo->tx_lock);
 		printk(KERN_ERR "%s: Attempted send on closed socket\n",
 		       lo->disk->disk_name);
-		req->errors++;
-		nbd_end_request(req);
-		return;
+		goto error_out;
 	}
 
 	lo->active_req = req;
@@ -475,8 +473,7 @@ static void nbd_handle_req(struct nbd_de
 	if (nbd_send_req(lo, req) != 0) {
 		printk(KERN_ERR "%s: Request send failed\n",
 				lo->disk->disk_name);
-		req->errors++;
-		nbd_end_request(req);
+		goto error_out;
 	} else {
 		spin_lock(&lo->queue_lock);
 		list_add(&req->queuelist, &lo->queue_head);
@@ -563,7 +560,7 @@ static int nbd_ioctl(struct block_device
 	struct nbd_device *lo = bdev->bd_disk->private_data;
 	struct file *file;
 	int error;
-	struct request sreq ;
+	struct request sreq;
 	struct task_struct *thread;
 
 	if (!capable(CAP_SYS_ADMIN))

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

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

* Re: nbd: clean up error handling
  2008-12-18 18:21 nbd: clean up error handling Pavel Machek
@ 2008-12-18 19:15 ` Paul Clements
  2008-12-28  8:03   ` Pavel Machek
  0 siblings, 1 reply; 3+ messages in thread
From: Paul Clements @ 2008-12-18 19:15 UTC (permalink / raw)
  To: Pavel Machek; +Cc: kernel list, Andrew Morton

Hi Pavel,

hanks for the patch...

Pavel Machek wrote:
> Uses existing error_out: label instead of hardcoding error action.
> 
> Signed-off-by: Pavel Machek <pavel@suse.cz>

> @@ -475,8 +473,7 @@ static void nbd_handle_req(struct nbd_de
>  	if (nbd_send_req(lo, req) != 0) {
>  		printk(KERN_ERR "%s: Request send failed\n",
>  				lo->disk->disk_name);
> -		req->errors++;
> -		nbd_end_request(req);
> +		goto error_out;

This one is not correct. We don't return immediately here.


--
Paul

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

* Re: nbd: clean up error handling
  2008-12-18 19:15 ` Paul Clements
@ 2008-12-28  8:03   ` Pavel Machek
  0 siblings, 0 replies; 3+ messages in thread
From: Pavel Machek @ 2008-12-28  8:03 UTC (permalink / raw)
  To: Paul Clements; +Cc: kernel list, Andrew Morton

On Thu 2008-12-18 14:15:39, Paul Clements wrote:
> Hi Pavel,
>
> hanks for the patch...
>
> Pavel Machek wrote:
>> Uses existing error_out: label instead of hardcoding error action.
>>
>> Signed-off-by: Pavel Machek <pavel@suse.cz>
>
>> @@ -475,8 +473,7 @@ static void nbd_handle_req(struct nbd_de
>>  	if (nbd_send_req(lo, req) != 0) {
>>  		printk(KERN_ERR "%s: Request send failed\n",
>>  				lo->disk->disk_name);
>> -		req->errors++;
>> -		nbd_end_request(req);
>> +		goto error_out;
>
> This one is not correct. We don't return immediately here.

Sorry about that. Will do next series shortly...
									Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

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

end of thread, other threads:[~2008-12-28  8:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-18 18:21 nbd: clean up error handling Pavel Machek
2008-12-18 19:15 ` Paul Clements
2008-12-28  8:03   ` Pavel Machek

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