linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ide-cd: fix REQ_QUIET tests in cdrom_decode_status
@ 2009-04-27 16:03 Borislav Petkov
  2009-04-28 10:37 ` Sergei Shtylyov
  2009-04-28 21:40 ` Helge Deller
  0 siblings, 2 replies; 6+ messages in thread
From: Borislav Petkov @ 2009-04-27 16:03 UTC (permalink / raw)
  To: Linux IDE mailing list
  Cc: Bartlomiej Zolnierkiewicz, Helge Deller, Jens Axboe

From: Borislav Petkov <petkovbb@gmail.com>
Date: Mon, 27 Apr 2009 14:11:32 +0200
Subject: [PATCH] ide-cd: fix REQ_QUIET tests in cdrom_decode_status

Original patch (dfa4411cc3a690011cab90e9a536938795366cf9) was buggy.
This is a more proper fix which introduces blk_rq_quiet() macro
alleviating the need for dumb, too short caching variables.

Thanks to Helge Deller and Bart for debugging this.

Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
---
 drivers/ide/ide-cd.c   |    9 ++++-----
 include/linux/blkdev.h |    1 +
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c
index 6736287..a75e4ee 100644
--- a/drivers/ide/ide-cd.c
+++ b/drivers/ide/ide-cd.c
@@ -283,7 +283,6 @@ static int cdrom_decode_status(ide_drive_t *drive, u8 stat)
 	ide_hwif_t *hwif = drive->hwif;
 	struct request *rq = hwif->rq;
 	int err, sense_key, do_end_request = 0;
-	u8 quiet = rq->cmd_flags & REQ_QUIET;

 	/* get the IDE error register */
 	err = ide_read_error(drive);
@@ -318,7 +317,7 @@ static int cdrom_decode_status(ide_drive_t *drive, u8 stat)
 		} else {
 			cdrom_saw_media_change(drive);

-			if (blk_fs_request(rq) && !quiet)
+			if (blk_fs_request(rq) && !blk_rq_quiet(rq))
 				printk(KERN_ERR PFX "%s: tray open\n",
 					drive->name);
 		}
@@ -353,7 +352,7 @@ static int cdrom_decode_status(ide_drive_t *drive, u8 stat)
 		 * No point in retrying after an illegal request or data
 		 * protect error.
 		 */
-		if (!quiet)
+		if (!blk_rq_quiet(rq))
 			ide_dump_status(drive, "command error", stat);
 		do_end_request = 1;
 		break;
@@ -362,14 +361,14 @@ static int cdrom_decode_status(ide_drive_t
*drive, u8 stat)
 		 * No point in re-trying a zillion times on a bad sector.
 		 * If we got here the error is not correctable.
 		 */
-		if (!quiet)
+		if (!blk_rq_quiet(rq))
 			ide_dump_status(drive, "media error "
 					"(bad sector)", stat);
 		do_end_request = 1;
 		break;
 	case BLANK_CHECK:
 		/* disk appears blank? */
-		if (!quiet)
+		if (!blk_rq_quiet(rq))
 			ide_dump_status(drive, "media error (blank)",
 					stat);
 		do_end_request = 1;
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index ba54c83..6f841fb 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -598,6 +598,7 @@ enum {
 				 blk_failfast_transport(rq) ||	\
 				 blk_failfast_driver(rq))
 #define blk_rq_started(rq)	((rq)->cmd_flags & REQ_STARTED)
+#define blk_rq_quiet(rq)	((rq)->cmd_flags & REQ_QUIET)

 #define blk_account_rq(rq)	(blk_rq_started(rq) && (blk_fs_request(rq)
|| blk_discard_rq(rq)))

-- 
1.6.2.4


-- 
Regards/Gruss,
Boris

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

* Re: [PATCH] ide-cd: fix REQ_QUIET tests in cdrom_decode_status
  2009-04-27 16:03 [PATCH] ide-cd: fix REQ_QUIET tests in cdrom_decode_status Borislav Petkov
@ 2009-04-28 10:37 ` Sergei Shtylyov
  2009-04-28 21:38   ` Borislav Petkov
  2009-04-28 21:40 ` Helge Deller
  1 sibling, 1 reply; 6+ messages in thread
From: Sergei Shtylyov @ 2009-04-28 10:37 UTC (permalink / raw)
  To: petkovbb
  Cc: Linux IDE mailing list, Bartlomiej Zolnierkiewicz, Helge Deller,
	Jens Axboe

Borislav Petkov wrote:

> Original patch (dfa4411cc3a690011cab90e9a536938795366cf9) was buggy.
> This is a more proper fix which introduces blk_rq_quiet() macro
> alleviating the need for dumb, too short caching variables.

> Thanks to Helge Deller and Bart for debugging this.

> Signed-off-by: Borislav Petkov <petkovbb@gmail.com>

> diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
> index ba54c83..6f841fb 100644
> --- a/include/linux/blkdev.h
> +++ b/include/linux/blkdev.h
> @@ -598,6 +598,7 @@ enum {
>  				 blk_failfast_transport(rq) ||	\
>  				 blk_failfast_driver(rq))
>  #define blk_rq_started(rq)	((rq)->cmd_flags & REQ_STARTED)
> +#define blk_rq_quiet(rq)	((rq)->cmd_flags & REQ_QUIET)
> 
>  #define blk_account_rq(rq)	(blk_rq_started(rq) && (blk_fs_request(rq)
> || blk_discard_rq(rq)))

    The patch looks like-wrapped...

MBR, Sergei

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

* [PATCH] ide-cd: fix REQ_QUIET tests in cdrom_decode_status
  2009-04-28 10:37 ` Sergei Shtylyov
@ 2009-04-28 21:38   ` Borislav Petkov
  2009-04-30 16:28     ` Bartlomiej Zolnierkiewicz
  0 siblings, 1 reply; 6+ messages in thread
From: Borislav Petkov @ 2009-04-28 21:38 UTC (permalink / raw)
  To: linux-ide
  Cc: Bartlomiej Zolnierkiewicz, Helge Deller, Jens Axboe,
	Sergei Shtylyov

Here's a non-wrapped version, Sergei thanks for catching that.

--
From: Borislav Petkov <petkovbb@gmail.com>
Date: Mon, 27 Apr 2009 14:11:32 +0200
Subject: [PATCH] ide-cd: fix REQ_QUIET tests in cdrom_decode_status

Original patch (dfa4411cc3a690011cab90e9a536938795366cf9) was buggy.
This is a more proper fix which introduces blk_rq_quiet() macro
alleviating the need for dumb, too short caching variables.

Thanks to Helge Deller and Bart for debugging this.

Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
---
 drivers/ide/ide-cd.c   |    9 ++++-----
 include/linux/blkdev.h |    1 +
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c
index 07fb9e4..e4df578 100644
--- a/drivers/ide/ide-cd.c
+++ b/drivers/ide/ide-cd.c
@@ -282,7 +282,6 @@ static int cdrom_decode_status(ide_drive_t *drive, u8 stat)
 	ide_hwif_t *hwif = drive->hwif;
 	struct request *rq = hwif->rq;
 	int err, sense_key, do_end_request = 0;
-	u8 quiet = rq->cmd_flags & REQ_QUIET;
 
 	/* get the IDE error register */
 	err = ide_read_error(drive);
@@ -317,7 +316,7 @@ static int cdrom_decode_status(ide_drive_t *drive, u8 stat)
 		} else {
 			cdrom_saw_media_change(drive);
 
-			if (blk_fs_request(rq) && !quiet)
+			if (blk_fs_request(rq) && !blk_rq_quiet(rq))
 				printk(KERN_ERR PFX "%s: tray open\n",
 					drive->name);
 		}
@@ -352,7 +351,7 @@ static int cdrom_decode_status(ide_drive_t *drive, u8 stat)
 		 * No point in retrying after an illegal request or data
 		 * protect error.
 		 */
-		if (!quiet)
+		if (!blk_rq_quiet(rq))
 			ide_dump_status(drive, "command error", stat);
 		do_end_request = 1;
 		break;
@@ -361,14 +360,14 @@ static int cdrom_decode_status(ide_drive_t *drive, u8 stat)
 		 * No point in re-trying a zillion times on a bad sector.
 		 * If we got here the error is not correctable.
 		 */
-		if (!quiet)
+		if (!blk_rq_quiet(rq))
 			ide_dump_status(drive, "media error "
 					"(bad sector)", stat);
 		do_end_request = 1;
 		break;
 	case BLANK_CHECK:
 		/* disk appears blank? */
-		if (!quiet)
+		if (!blk_rq_quiet(rq))
 			ide_dump_status(drive, "media error (blank)",
 					stat);
 		do_end_request = 1;
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index ba54c83..6f841fb 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -598,6 +598,7 @@ enum {
 				 blk_failfast_transport(rq) ||	\
 				 blk_failfast_driver(rq))
 #define blk_rq_started(rq)	((rq)->cmd_flags & REQ_STARTED)
+#define blk_rq_quiet(rq)	((rq)->cmd_flags & REQ_QUIET)
 
 #define blk_account_rq(rq)	(blk_rq_started(rq) && (blk_fs_request(rq) || blk_discard_rq(rq))) 
 
-- 
1.6.2.4


-- 
Regards/Gruss,
    Boris.

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

* Re: [PATCH] ide-cd: fix REQ_QUIET tests in cdrom_decode_status
  2009-04-27 16:03 [PATCH] ide-cd: fix REQ_QUIET tests in cdrom_decode_status Borislav Petkov
  2009-04-28 10:37 ` Sergei Shtylyov
@ 2009-04-28 21:40 ` Helge Deller
  2009-04-29  5:26   ` Borislav Petkov
  1 sibling, 1 reply; 6+ messages in thread
From: Helge Deller @ 2009-04-28 21:40 UTC (permalink / raw)
  To: petkovbb
  Cc: Linux IDE mailing list, Bartlomiej Zolnierkiewicz, Jens Axboe,
	sshtylyov

Borislav Petkov wrote:
> From: Borislav Petkov <petkovbb@gmail.com>
> Date: Mon, 27 Apr 2009 14:11:32 +0200
> Subject: [PATCH] ide-cd: fix REQ_QUIET tests in cdrom_decode_status
> 
> Original patch (dfa4411cc3a690011cab90e9a536938795366cf9) was buggy.
> This is a more proper fix which introduces blk_rq_quiet() macro
> alleviating the need for dumb, too short caching variables.
> 
> Thanks to Helge Deller and Bart for debugging this.
> 
> Signed-off-by: Borislav Petkov <petkovbb@gmail.com>

Thanks a lot Borislav !
As Sergei already mentioned, the patch below is line-wrapped.

Anyway, I applied it on top of 2.6.30-rc3, fixed up the rejections manually 
and can confirm that this patch fixes the problems I reported for the parisc 
platform.

You may add my signed-off-by when you resend the fixed patch:
Signed-off-by: Helge Deller <deller@gmx.de>


> ---
>  drivers/ide/ide-cd.c   |    9 ++++-----
>  include/linux/blkdev.h |    1 +
>  2 files changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c
> index 6736287..a75e4ee 100644
> --- a/drivers/ide/ide-cd.c
> +++ b/drivers/ide/ide-cd.c
> @@ -283,7 +283,6 @@ static int cdrom_decode_status(ide_drive_t *drive, u8 stat)
>  	ide_hwif_t *hwif = drive->hwif;
>  	struct request *rq = hwif->rq;
>  	int err, sense_key, do_end_request = 0;
> -	u8 quiet = rq->cmd_flags & REQ_QUIET;
> 
>  	/* get the IDE error register */
>  	err = ide_read_error(drive);
> @@ -318,7 +317,7 @@ static int cdrom_decode_status(ide_drive_t *drive, u8 stat)
>  		} else {
>  			cdrom_saw_media_change(drive);
> 
> -			if (blk_fs_request(rq) && !quiet)
> +			if (blk_fs_request(rq) && !blk_rq_quiet(rq))
>  				printk(KERN_ERR PFX "%s: tray open\n",
>  					drive->name);
>  		}
> @@ -353,7 +352,7 @@ static int cdrom_decode_status(ide_drive_t *drive, u8 stat)
>  		 * No point in retrying after an illegal request or data
>  		 * protect error.
>  		 */
> -		if (!quiet)
> +		if (!blk_rq_quiet(rq))
>  			ide_dump_status(drive, "command error", stat);
>  		do_end_request = 1;
>  		break;
> @@ -362,14 +361,14 @@ static int cdrom_decode_status(ide_drive_t
> *drive, u8 stat)
>  		 * No point in re-trying a zillion times on a bad sector.
>  		 * If we got here the error is not correctable.
>  		 */
> -		if (!quiet)
> +		if (!blk_rq_quiet(rq))
>  			ide_dump_status(drive, "media error "
>  					"(bad sector)", stat);
>  		do_end_request = 1;
>  		break;
>  	case BLANK_CHECK:
>  		/* disk appears blank? */
> -		if (!quiet)
> +		if (!blk_rq_quiet(rq))
>  			ide_dump_status(drive, "media error (blank)",
>  					stat);
>  		do_end_request = 1;
> diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
> index ba54c83..6f841fb 100644
> --- a/include/linux/blkdev.h
> +++ b/include/linux/blkdev.h
> @@ -598,6 +598,7 @@ enum {
>  				 blk_failfast_transport(rq) ||	\
>  				 blk_failfast_driver(rq))
>  #define blk_rq_started(rq)	((rq)->cmd_flags & REQ_STARTED)
> +#define blk_rq_quiet(rq)	((rq)->cmd_flags & REQ_QUIET)
> 
>  #define blk_account_rq(rq)	(blk_rq_started(rq) && (blk_fs_request(rq)
> || blk_discard_rq(rq)))
> 


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

* Re: [PATCH] ide-cd: fix REQ_QUIET tests in cdrom_decode_status
  2009-04-28 21:40 ` Helge Deller
@ 2009-04-29  5:26   ` Borislav Petkov
  0 siblings, 0 replies; 6+ messages in thread
From: Borislav Petkov @ 2009-04-29  5:26 UTC (permalink / raw)
  To: Helge Deller
  Cc: Linux IDE mailing list, Bartlomiej Zolnierkiewicz, Jens Axboe,
	sshtylyov

On Tue, Apr 28, 2009 at 11:40:14PM +0200, Helge Deller wrote:
> Borislav Petkov wrote:
> > From: Borislav Petkov <petkovbb@gmail.com>
> > Date: Mon, 27 Apr 2009 14:11:32 +0200
> > Subject: [PATCH] ide-cd: fix REQ_QUIET tests in cdrom_decode_status
> > 
> > Original patch (dfa4411cc3a690011cab90e9a536938795366cf9) was buggy.
> > This is a more proper fix which introduces blk_rq_quiet() macro
> > alleviating the need for dumb, too short caching variables.
> > 
> > Thanks to Helge Deller and Bart for debugging this.
> > 
> > Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
> 
> Thanks a lot Borislav !
> As Sergei already mentioned, the patch below is line-wrapped.
> 
> Anyway, I applied it on top of 2.6.30-rc3, fixed up the rejections manually 
> and can confirm that this patch fixes the problems I reported for the parisc 
> platform.
> 
> You may add my signed-off-by when you resend the fixed patch:

Thanks, but I sent a fixed one exactly two minutes :) before your message.

-- 
Regards/Gruss,
    Boris.

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

* Re: [PATCH] ide-cd: fix REQ_QUIET tests in cdrom_decode_status
  2009-04-28 21:38   ` Borislav Petkov
@ 2009-04-30 16:28     ` Bartlomiej Zolnierkiewicz
  0 siblings, 0 replies; 6+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2009-04-30 16:28 UTC (permalink / raw)
  To: petkovbb; +Cc: linux-ide, Helge Deller, Jens Axboe, Sergei Shtylyov

On Tuesday 28 April 2009 23:38:14 Borislav Petkov wrote:
> Here's a non-wrapped version, Sergei thanks for catching that.
> 
> --
> From: Borislav Petkov <petkovbb@gmail.com>
> Date: Mon, 27 Apr 2009 14:11:32 +0200
> Subject: [PATCH] ide-cd: fix REQ_QUIET tests in cdrom_decode_status
> 
> Original patch (dfa4411cc3a690011cab90e9a536938795366cf9) was buggy.
> This is a more proper fix which introduces blk_rq_quiet() macro
> alleviating the need for dumb, too short caching variables.
> 
> Thanks to Helge Deller and Bart for debugging this.
> 
> Signed-off-by: Borislav Petkov <petkovbb@gmail.com>

applied to ide-2.6.git/for-linus branch

[ with "Reported-and-tested-by: Helge Deller <deller@gmx.de>" added ]

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

end of thread, other threads:[~2009-04-30 16:37 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-27 16:03 [PATCH] ide-cd: fix REQ_QUIET tests in cdrom_decode_status Borislav Petkov
2009-04-28 10:37 ` Sergei Shtylyov
2009-04-28 21:38   ` Borislav Petkov
2009-04-30 16:28     ` Bartlomiej Zolnierkiewicz
2009-04-28 21:40 ` Helge Deller
2009-04-29  5:26   ` Borislav Petkov

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