Skip to contentSkip to conversation

scsi: fix the wrong position of the comment

PATCH In review Akinobu Mita 5 participants 7 messages Mar 10, 2013 – Mar 13, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 scsi: fix the wrong position of the comment

This fixes the wrong position of the comment introduced by scsi-rename-random32-to-prandom_u32.patch in the -mm tree.

Cc "James E.J. Bottomley" <[email protected]>
Cc Andrew Vasquez <[email protected]>
---
 drivers/scsi/qla2xxx/qla_attr.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/scsi/qla2xxx/qla_attr.c +3 -3
index 04bf7b8..e44d47e 100644
@@ -1939,13 +1939,13 @@ qla24xx_vport_delete(struct fc_vport *fc_vport)
 	}
 
 	/* No pending activities shall be there on the vha now */
-	if (ql2xextended_error_logging & ql_dbg_user)
-		msleep(prandom_u32() % 10);
+	if (ql2xextended_error_logging & ql_dbg_user) {
 		/*
 		 * Just to see if something falls on the net we have placed
 		 * below
 		 */
-
+		msleep(prandom_u32() % 10);
+	}
 	BUG_ON(atomic_read(&vha->vref_count));
 
 	qla2x00_free_fcports(vha);
Signature · 1 line
1.8.1.4
#1 lore raw

[missing SCSI cc added]

Quoted 18 lines · Akinobu Mita

This fixes the wrong position of the comment introduced by scsi-rename-random32-to-prandom_u32.patch in the -mm tree.

Cc "James E.J. Bottomley" <[email protected]>
Cc Andrew Vasquez <[email protected]>
---
 drivers/scsi/qla2xxx/qla_attr.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/scsi/qla2xxx/qla_attr.c +0 -0
index 04bf7b8..e44d47e 100644
@@ -1939,13 +1939,13 @@ qla24xx_vport_delete(struct fc_vport *fc_vport)
 	}
 
 	/* No pending activities shall be there on the vha now */

drivers/scsi/qla2xxx/qla_attr.c qla24xx_vport_delete(struct fc_vport *fc_vport) · line 1948

Quoted 10 lines
drivers/scsi/qla2xxx/qla_attr.c +3 -3
-	if (ql2xextended_error_logging & ql_dbg_user)
-		msleep(prandom_u32() % 10);
+	if (ql2xextended_error_logging & ql_dbg_user) {
 		/*
 		 * Just to see if something falls on the net we have placed
 		 * below
 		 */
-
+		msleep(prandom_u32() % 10);
+	}

I don't git a toss if it's random or prandom: Andrew: get rid of it; we do not sleep in kernel for random intervals whatever the provocation ... if this is supposed to be a warning or error condition then print something.

James

#2 lore raw
Quoted 19 lines · On Sun, 10 Mar 2013 08:22:47 +0000 James Bottomley <[email protected]>…

[missing SCSI cc added]

Quoted 17 lines · Akinobu Mita

This fixes the wrong position of the comment introduced by scsi-rename-random32-to-prandom_u32.patch in the -mm tree.

Cc "James E.J. Bottomley" <[email protected]>
Cc Andrew Vasquez <[email protected]>
---
 drivers/scsi/qla2xxx/qla_attr.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/scsi/qla2xxx/qla_attr.c +0 -0
index 04bf7b8..e44d47e 100644
@@ -1939,13 +1939,13 @@ qla24xx_vport_delete(struct fc_vport *fc_vport)
 	}
 
Quoted 16 lines

drivers/scsi/qla2xxx/qla_attr.c qla24xx_vport_delete(struct fc_vport *fc_vport) · line 1948

Quoted 11 lines
drivers/scsi/qla2xxx/qla_attr.c +3 -3
 	/* No pending activities shall be there on the vha now */
-	if (ql2xextended_error_logging & ql_dbg_user)
-		msleep(prandom_u32() % 10);
+	if (ql2xextended_error_logging & ql_dbg_user) {
 		/*
 		 * Just to see if something falls on the net we have placed
 		 * below
 		 */
-
+		msleep(prandom_u32() % 10);
+	}

I don't git a toss if it's random or prandom: Andrew: get rid of it; we do not sleep in kernel for random intervals whatever the provocation ... if this is supposed to be a warning or error condition then print something.

That msleep was added by

commit feafb7b1714cf599a6d0fed45801ab3f66046cbd

Author:     Arun Easi <[email protected]>
AuthorDate: Fri Sep 3 14:57:00 2010 -0700
Commit:     James Bottomley <[email protected]>
CommitDate: Sun Sep 5 15:13:12 2010 -0300

[SCSI] qla2xxx: Fix vport delete issues

#3 lore raw
Quoted 40 lines · Andrew Morton
Quoted 19 lines · On Sun, 10 Mar 2013 08:22:47 +0000 James Bottomley <[email protected]>…

[missing SCSI cc added]

Quoted 17 lines · Akinobu Mita

This fixes the wrong position of the comment introduced by scsi-rename-random32-to-prandom_u32.patch in the -mm tree.

Cc "James E.J. Bottomley" <[email protected]>
Cc Andrew Vasquez <[email protected]>
---
 drivers/scsi/qla2xxx/qla_attr.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/scsi/qla2xxx/qla_attr.c +0 -0
index 04bf7b8..e44d47e 100644
@@ -1939,13 +1939,13 @@ qla24xx_vport_delete(struct fc_vport *fc_vport)
 	}
 
Quoted 16 lines

drivers/scsi/qla2xxx/qla_attr.c qla24xx_vport_delete(struct fc_vport *fc_vport) · line 1948

Quoted 11 lines
drivers/scsi/qla2xxx/qla_attr.c +3 -3
 	/* No pending activities shall be there on the vha now */
-	if (ql2xextended_error_logging & ql_dbg_user)
-		msleep(prandom_u32() % 10);
+	if (ql2xextended_error_logging & ql_dbg_user) {
 		/*
 		 * Just to see if something falls on the net we have placed
 		 * below
 		 */
-
+		msleep(prandom_u32() % 10);
+	}

I don't git a toss if it's random or prandom: Andrew: get rid of it; we do not sleep in kernel for random intervals whatever the provocation ... if this is supposed to be a warning or error condition then print something.

That msleep was added by

Quoted 7 lines

commit feafb7b1714cf599a6d0fed45801ab3f66046cbd

Author:     Arun Easi <[email protected]>
AuthorDate: Fri Sep 3 14:57:00 2010 -0700
Commit:     James Bottomley <[email protected]>
CommitDate: Sun Sep 5 15:13:12 2010 -0300

[SCSI] qla2xxx: Fix vport delete issues

Sorry, I didn't notice multiple Andrews on the cc list. I meant Andrew Vasquez (or other member of the qla team) remove this, please (and preferably do something correct).

Thanks,

James

#4 lore raw
Quoted 47 lines · James Bottomley
Quoted 46 lines · Andrew Morton
Quoted 19 lines · On Sun, 10 Mar 2013 08:22:47 +0000 James Bottomley <[email protected]>…

[missing SCSI cc added]

Quoted 17 lines · Akinobu Mita

This fixes the wrong position of the comment introduced by scsi-rename-random32-to-prandom_u32.patch in the -mm tree.

Cc "James E.J. Bottomley" <[email protected]>
Cc Andrew Vasquez <[email protected]>
---
 drivers/scsi/qla2xxx/qla_attr.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/scsi/qla2xxx/qla_attr.c +0 -0
index 04bf7b8..e44d47e 100644
@@ -1939,13 +1939,13 @@ qla24xx_vport_delete(struct fc_vport *fc_vport)
        }
 
Quoted 16 lines

drivers/scsi/qla2xxx/qla_attr.c qla24xx_vport_delete(struct fc_vport *fc_vport) · line 1948

Quoted 11 lines
drivers/scsi/qla2xxx/qla_attr.c +3 -3
        /* No pending activities shall be there on the vha now */
-       if (ql2xextended_error_logging & ql_dbg_user)
-               msleep(prandom_u32() % 10);
+       if (ql2xextended_error_logging & ql_dbg_user) {
                /*
                 * Just to see if something falls on the net we have placed
                 * below
                 */
-
+               msleep(prandom_u32() % 10);
+       }

I don't git a toss if it's random or prandom: Andrew: get rid of it; we do not sleep in kernel for random intervals whatever the provocation ... if this is supposed to be a warning or error condition then print something.

That msleep was added by

commit feafb7b1714cf599a6d0fed45801ab3f66046cbd

Author:     Arun Easi <[email protected]>
AuthorDate: Fri Sep 3 14:57:00 2010 -0700
Commit:     James Bottomley <[email protected]>
CommitDate: Sun Sep 5 15:13:12 2010 -0300
Quoted 6 lines
Quoted 1 line

[SCSI] qla2xxx: Fix vport delete issues

Sorry, I didn't notice multiple Andrews on the cc list. I meant Andrew Vasquez (or other member of the qla team) remove this, please (and preferably do something correct).

James,

We'll take a look at this, yes. Adding Giri and Co. to the CC.

Thanks, AV

________________________________

This message and any attached documents contain information from QLogic Corporation or its wholly-owned subsidiaries that may be confidential. If you are not the intended recipient, you may not read, copy, distribute, or use this information. If you have received this transmission in error, please notify the sender immediately by reply e-mail and then delete this message.

#5 lore raw
In reply to Akinobu Mita
Quoted 19 lines · Akinobu Mita

This fixes the wrong position of the comment introduced by scsi-rename-random32-to-prandom_u32.patch in the -mm tree.

Cc "James E.J. Bottomley" <[email protected]>
Cc Andrew Vasquez <[email protected]>
---
 drivers/scsi/qla2xxx/qla_attr.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/scsi/qla2xxx/qla_attr.c +0 -1
index 04bf7b8..e44d47e 100644
@@ -1939,13 +1939,13 @@ qla24xx_vport_delete(struct fc_vport *fc_vport)
 	}
 
 	/* No pending activities shall be there on the vha now */
-	if (ql2xextended_error_logging & ql_dbg_user)

drivers/scsi/qla2xxx/qla_attr.c qla24xx_vport_delete(struct fc_vport *fc_vport) · line 1949

Quoted 10 lines
drivers/scsi/qla2xxx/qla_attr.c +3 -2
-		msleep(prandom_u32() % 10);
+	if (ql2xextended_error_logging & ql_dbg_user) {
 		/*
 		 * Just to see if something falls on the net we have placed
 		 * below
 		 */
-
+		msleep(prandom_u32() % 10);
+	}
 	BUG_ON(atomic_read(&vha->vref_count));

As others have noted, the msleep is potentially a crock. However, this particular patch is also incorrect - the *real* problem is that the 4 line comment connected to the BUG_ON is mis-indented.

The patch *should* make it look like this:

	/* No pending activities shall be there on the vha now */
	if (ql2xextended_error_logging & ql_dbg_user)
		msleep(prandom_u32() % 10);
	/*
	 * Just to see if something falls on the net we have placed
	 * below
	 */
	BUG_ON(atomic_read(&vha->vref_count));

And a different patch should fix the msleep issue.

#6 lore raw

2013/3/12 <[email protected]>:

Quoted 18 lines · Akinobu Mita
Quoted 17 lines

This fixes the wrong position of the comment introduced by scsi-rename-random32-to-prandom_u32.patch in the -mm tree.

Cc "James E.J. Bottomley" <[email protected]>
Cc Andrew Vasquez <[email protected]>
---
 drivers/scsi/qla2xxx/qla_attr.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/scsi/qla2xxx/qla_attr.c +0 -0
index 04bf7b8..e44d47e 100644
@@ -1939,13 +1939,13 @@ qla24xx_vport_delete(struct fc_vport *fc_vport)
      }
 
Quoted 16 lines

drivers/scsi/qla2xxx/qla_attr.c qla24xx_vport_delete(struct fc_vport *fc_vport) · line 1949

Quoted 12 lines
drivers/scsi/qla2xxx/qla_attr.c +3 -3
      /* No pending activities shall be there on the vha now */
-     if (ql2xextended_error_logging & ql_dbg_user)
-             msleep(prandom_u32() % 10);
+     if (ql2xextended_error_logging & ql_dbg_user) {
              /*
               * Just to see if something falls on the net we have placed
               * below
               */
-
+             msleep(prandom_u32() % 10);
+     }
      BUG_ON(atomic_read(&vha->vref_count));

As others have noted, the msleep is potentially a crock. However, this particular patch is also incorrect - the *real* problem is that the 4 line comment connected to the BUG_ON is mis-indented.

In the original code (quoted below), the comment actually connected to the msleep(), but the word "below" in the comment points to BUG_ON. So the comment should also be updated in this patch...

/* No pending activities shall be there on the vha now */ if (ql2xextended_error_logging & ql_dbg_user)
msleep(random32()%10); /* Just to see if something falls on
* the net we have placed below */

BUG_ON(atomic_read(&vha->vref_count));