Skip to contentSkip to conversation

csiostor: Fix backwards locking in the function __csio_unreg_rnode

PATCH In review Bastien Philbert 5 participants 13 messages Apr 5, 2016 – Apr 6, 2016 SCSI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 csiostor: Fix backwards locking in the function __csio_unreg_rnode

This fixes backwards locking in the function __csio_unreg_rnode to properly lock before the call to the function csio_unreg_rnode and not unlock with spin_unlock_irq as this would not allow the proper protection for concurrent access on the shared csio_hw structure pointer hw. In addition switch the locking after the critical region function call to properly unlock instead with spin_unlock_irq on

---
 drivers/scsi/csiostor/csio_rnode.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/scsi/csiostor/csio_rnode.c +2 -2
index e9c3b04..029a09e 100644
@@ -580,9 +580,9 @@ __csio_unreg_rnode(struct csio_rnode *rn)
 		ln->last_scan_ntgts--;
 	}
 
-	spin_unlock_irq(&hw->lock);
-	csio_unreg_rnode(rn);
 	spin_lock_irq(&hw->lock);
+	csio_unreg_rnode(rn);
+	spin_unlock_irq(&hw->lock);
 
 	/* Cleanup I/Os that were waiting for rnode to unregister */
 	if (cmpl)
Signature · 1 line
2.5.0
#1 lore raw

Hi Bastien,

Quoted 17 lines · Bastien Philbert

This fixes backwards locking in the function __csio_unreg_rnode to properly lock before the call to the function csio_unreg_rnode and not unlock with spin_unlock_irq as this would not allow the proper protection for concurrent access on the shared csio_hw structure pointer hw. In addition switch the locking after the critical region function call to properly unlock instead with spin_unlock_irq on

---
 drivers/scsi/csiostor/csio_rnode.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/scsi/csiostor/csio_rnode.c +0 -0
index e9c3b04..029a09e 100644

drivers/scsi/csiostor/csio_rnode.c __csio_unreg_rnode(struct csio_rnode *rn) · line 585

Quoted 8 lines
drivers/scsi/csiostor/csio_rnode.c +2 -2
@@ -580,9 +580,9 @@ __csio_unreg_rnode(struct csio_rnode *rn)
                ln->last_scan_ntgts--;
        }
 
-       spin_unlock_irq(&hw->lock);
-       csio_unreg_rnode(rn);
        spin_lock_irq(&hw->lock);
+       csio_unreg_rnode(rn);
+       spin_unlock_irq(&hw->lock);

Are you _certain_ this is correct? This construct usually appears when a function has a particular lock held, then needs to unlock it to call some other function. Are you _certain_ that this isn't the case?

Thanks,

Signature · 4 lines
Julian Calaby

Email: [email protected]
Profile: http://www.google.com/profiles/julian.calaby/
#2 lore raw
Quoted 34 lines · Julian Calaby

Hi Bastien,

Quoted 17 lines · Bastien Philbert

This fixes backwards locking in the function __csio_unreg_rnode to properly lock before the call to the function csio_unreg_rnode and not unlock with spin_unlock_irq as this would not allow the proper protection for concurrent access on the shared csio_hw structure pointer hw. In addition switch the locking after the critical region function call to properly unlock instead with spin_unlock_irq on

---
 drivers/scsi/csiostor/csio_rnode.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/scsi/csiostor/csio_rnode.c +0 -0
index e9c3b04..029a09e 100644

drivers/scsi/csiostor/csio_rnode.c __csio_unreg_rnode(struct csio_rnode *rn) · line 585

Quoted 8 lines
drivers/scsi/csiostor/csio_rnode.c +2 -2
@@ -580,9 +580,9 @@ __csio_unreg_rnode(struct csio_rnode *rn)
                ln->last_scan_ntgts--;
        }
 
-       spin_unlock_irq(&hw->lock);
-       csio_unreg_rnode(rn);
        spin_lock_irq(&hw->lock);
+       csio_unreg_rnode(rn);
+       spin_unlock_irq(&hw->lock);

Are you _certain_ this is correct? This construct usually appears when a function has a particular lock held, then needs to unlock it to call some other function. Are you _certain_ that this isn't the case?

Quoted 2 lines

Thanks,

Yes I am pretty certain this is correct. I checked the paths that called this function and it was weired that none of them gradded the spinlock before hand. Cheers,
Bastien

#3 lore raw
Quoted 43 lines · Bastien Philbert
Quoted 41 lines · Julian Calaby

Hi Bastien,

Quoted 22 lines · Bastien Philbert

This fixes backwards locking in the function __csio_unreg_rnode to
properly lock before the call to the function csio_unreg_rnode and
not unlock with spin_unlock_irq as this would not allow the proper
protection for concurrent access on the shared csio_hw structure pointer hw. In addition switch the locking after the critical region
function call to properly unlock instead with spin_unlock_irq on

---
 drivers/scsi/csiostor/csio_rnode.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/scsi/csiostor/csio_rnode.c +0 -0
index e9c3b04..029a09e 100644

drivers/scsi/csiostor/csio_rnode.c __csio_unreg_rnode(struct csio_rnode *rn) · line 585

Quoted 8 lines
drivers/scsi/csiostor/csio_rnode.c +2 -2
@@ -580,9 +580,9 @@ __csio_unreg_rnode(struct csio_rnode *rn)
                ln->last_scan_ntgts--;
        }
 
-       spin_unlock_irq(&hw->lock);
-       csio_unreg_rnode(rn);
        spin_lock_irq(&hw->lock);
+       csio_unreg_rnode(rn);
+       spin_unlock_irq(&hw->lock);

Are you _certain_ this is correct? This construct usually appears when
a function has a particular lock held, then needs to unlock it to call
some other function. Are you _certain_ that this isn't the case?

Quoted 5 lines
Quoted 2 lines

Thanks,

Yes I am pretty certain this is correct. I checked the paths that called this function
and it was weired that none of them gradded the spinlock before hand.

That's not good enough. If your theory is correct, lockdep should be dropping an already unlocked assertion in this codepath ... do you see this?

James

#4 lore raw
Quoted 50 lines · James Bottomley
Quoted 43 lines · Bastien Philbert
Quoted 41 lines · Julian Calaby

Hi Bastien,

Quoted 22 lines · Bastien Philbert

This fixes backwards locking in the function __csio_unreg_rnode to
properly lock before the call to the function csio_unreg_rnode and
not unlock with spin_unlock_irq as this would not allow the proper
protection for concurrent access on the shared csio_hw structure pointer hw. In addition switch the locking after the critical region
function call to properly unlock instead with spin_unlock_irq on

---
 drivers/scsi/csiostor/csio_rnode.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/scsi/csiostor/csio_rnode.c +0 -0
index e9c3b04..029a09e 100644

drivers/scsi/csiostor/csio_rnode.c __csio_unreg_rnode(struct csio_rnode *rn) · line 585

Quoted 8 lines
drivers/scsi/csiostor/csio_rnode.c +2 -2
@@ -580,9 +580,9 @@ __csio_unreg_rnode(struct csio_rnode *rn)
                ln->last_scan_ntgts--;
        }
 
-       spin_unlock_irq(&hw->lock);
-       csio_unreg_rnode(rn);
        spin_lock_irq(&hw->lock);
+       csio_unreg_rnode(rn);
+       spin_unlock_irq(&hw->lock);

Are you _certain_ this is correct? This construct usually appears when
a function has a particular lock held, then needs to unlock it to call
some other function. Are you _certain_ that this isn't the case?

Quoted 5 lines
Quoted 2 lines

Thanks,

Yes I am pretty certain this is correct. I checked the paths that called this function
and it was weired that none of them gradded the spinlock before hand.

Quoted 7 lines

That's not good enough. If your theory is correct, lockdep should be dropping an already unlocked assertion in this codepath ... do you see this?

James

Yes I do. For now just drop the patch but I am still concerned that we are double unlocking here. Bastien

Quoted 2 lines
#5 lore raw
Quoted 66 lines · Bastien Philbert
Quoted 64 lines · James Bottomley
Quoted 50 lines · Bastien Philbert
Quoted 48 lines · Julian Calaby

Hi Bastien,

Quoted 26 lines · Bastien Philbert

This fixes backwards locking in the function __csio_unreg_rnode
to
properly lock before the call to the function csio_unreg_rnode
and
not unlock with spin_unlock_irq as this would not allow the proper
protection for concurrent access on the shared csio_hw structure
pointer hw. In addition switch the locking after the critical region
function call to properly unlock instead with spin_unlock_irq on

---
 drivers/scsi/csiostor/csio_rnode.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/scsi/csiostor/csio_rnode.c +0 -0
index e9c3b04..029a09e 100644

drivers/scsi/csiostor/csio_rnode.c __csio_unreg_rnode(struct csio_rnode *rn) · line 585

Quoted 8 lines
drivers/scsi/csiostor/csio_rnode.c +2 -2
@@ -580,9 +580,9 @@ __csio_unreg_rnode(struct csio_rnode *rn)
                ln->last_scan_ntgts--;
        }
 
-       spin_unlock_irq(&hw->lock);
-       csio_unreg_rnode(rn);
        spin_lock_irq(&hw->lock);
+       csio_unreg_rnode(rn);
+       spin_unlock_irq(&hw->lock);

Are you _certain_ this is correct? This construct usually appears
when
a function has a particular lock held, then needs to unlock it to
call
some other function. Are you _certain_ that this isn't the case?

Quoted 6 lines
Quoted 2 lines

Thanks,

Yes I am pretty certain this is correct. I checked the paths that called this function
and it was weired that none of them gradded the spinlock before hand.

That's not good enough. If your theory is correct, lockdep should be
dropping an already unlocked assertion in this codepath ... do you see
this?

Quoted 4 lines
Quoted 3 lines

James

Yes I do.

You mean you don't see the lockdep assert, since you're asking to drop the patch?

Quoted 2 lines

For now just drop the patch but I am still concerned that we are
double unlocking here.

Really, no. The pattern in the code indicates the lock is expected to be held. This can be wrong (sometimes code moves or people forget), but if it is wrong we'll get an assert about unlock of an already unlocked lock. If there's no assert, the lock is held on entry and the code is correct.

You're proposing patches based on misunderstandings of the code which aren't backed up by actual issues and wasting everyone's time to look at them. Please begin with the hard evidence of a problem first, so post the lockdep assert in the changelog so we know there's a real problem.

James

#6 lore raw
Quoted 84 lines · James Bottomley
Quoted 66 lines · Bastien Philbert
Quoted 64 lines · James Bottomley
Quoted 50 lines · Bastien Philbert
Quoted 48 lines · Julian Calaby

Hi Bastien,

Quoted 26 lines · Bastien Philbert

This fixes backwards locking in the function __csio_unreg_rnode
to
properly lock before the call to the function csio_unreg_rnode
and
not unlock with spin_unlock_irq as this would not allow the proper
protection for concurrent access on the shared csio_hw structure
pointer hw. In addition switch the locking after the critical region
function call to properly unlock instead with spin_unlock_irq on

---
 drivers/scsi/csiostor/csio_rnode.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/scsi/csiostor/csio_rnode.c +0 -0
index e9c3b04..029a09e 100644

drivers/scsi/csiostor/csio_rnode.c __csio_unreg_rnode(struct csio_rnode *rn) · line 585

Quoted 8 lines
drivers/scsi/csiostor/csio_rnode.c +2 -2
@@ -580,9 +580,9 @@ __csio_unreg_rnode(struct csio_rnode *rn)
                ln->last_scan_ntgts--;
        }
 
-       spin_unlock_irq(&hw->lock);
-       csio_unreg_rnode(rn);
        spin_lock_irq(&hw->lock);
+       csio_unreg_rnode(rn);
+       spin_unlock_irq(&hw->lock);

Are you _certain_ this is correct? This construct usually appears
when
a function has a particular lock held, then needs to unlock it to
call
some other function. Are you _certain_ that this isn't the case?

Quoted 6 lines
Quoted 2 lines

Thanks,

Yes I am pretty certain this is correct. I checked the paths that called this function
and it was weired that none of them gradded the spinlock before hand.

That's not good enough. If your theory is correct, lockdep should be
dropping an already unlocked assertion in this codepath ... do you see
this?

Quoted 4 lines
Quoted 3 lines

James

Yes I do.

You mean you don't see the lockdep assert, since you're asking to drop the patch?

Quoted 2 lines

For now just drop the patch but I am still concerned that we are
double unlocking here.

Really, no. The pattern in the code indicates the lock is expected to be held. This can be wrong (sometimes code moves or people forget), but if it is wrong we'll get an assert about unlock of an already unlocked lock. If there's no assert, the lock is held on entry and the code is correct.

Quoted 8 lines

You're proposing patches based on misunderstandings of the code which aren't backed up by actual issues and wasting everyone's time to look at them. Please begin with the hard evidence of a problem first, so post the lockdep assert in the changelog so we know there's a real problem.

James

Certainly James. I think I just got carried away with the last few patches :(. Bastien

#7 lore raw
Quoted 102 lines · Bastien Philbert
Quoted 100 lines · James Bottomley
Quoted 76 lines · Bastien Philbert
Quoted 74 lines · James Bottomley
Quoted 56 lines · Bastien Philbert
Quoted 54 lines · Julian Calaby

Hi Bastien,

Quoted 30 lines · Bastien Philbert

This fixes backwards locking in the function __csio_unreg_rnode
to
properly lock before the call to the function csio_unreg_rnode
and
not unlock with spin_unlock_irq as this would not allow the
proper
protection for concurrent access on the shared csio_hw structure
pointer hw. In addition switch the locking after the critical
region
function call to properly unlock instead with spin_unlock_irq
on

Signed-off-by: Bastien Philbert <
[email protected]>

---
 drivers/scsi/csiostor/csio_rnode.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/scsi/csiostor/csio_rnode.c +0 -0
index e9c3b04..029a09e 100644

drivers/scsi/csiostor/csio_rnode.c __csio_unreg_rnode(struct csio_rnode · line 586

Quoted 9 lines
drivers/scsi/csiostor/csio_rnode.c +2 -2
@@ -580,9 +580,9 @@ __csio_unreg_rnode(struct csio_rnode
 *rn)
                ln->last_scan_ntgts--;
        }
 
-       spin_unlock_irq(&hw->lock);
-       csio_unreg_rnode(rn);
        spin_lock_irq(&hw->lock);
+       csio_unreg_rnode(rn);
+       spin_unlock_irq(&hw->lock);

Are you _certain_ this is correct? This construct usually appears
when
a function has a particular lock held, then needs to unlock it
to
call
some other function. Are you _certain_ that this isn't the case?

Quoted 8 lines
Quoted 2 lines

Thanks,

Yes I am pretty certain this is correct. I checked the paths that
called this function
and it was weired that none of them gradded the spinlock before
hand.

That's not good enough. If your theory is correct, lockdep should
be
dropping an already unlocked assertion in this codepath ... do you
see
this?

Quoted 4 lines
Quoted 3 lines

James

Yes I do.

You mean you don't see the lockdep assert, since you're asking to drop the patch?

Quoted 2 lines

For now just drop the patch but I am still concerned that we are
double unlocking here.

Really, no. The pattern in the code indicates the lock is expected to be held. This can be wrong (sometimes code moves or people forget), but if it is wrong we'll get an assert about unlock of an already unlocked lock. If there's no assert, the lock is held on entry and the code is correct.

You're proposing patches based on misunderstandings of the code which aren't backed up by actual issues and wasting everyone's time to look at them. Please begin with the hard evidence of a problem first, so post the lockdep assert in the changelog so we know there's a real problem.

Quoted 4 lines
Quoted 2 lines

James

Certainly James. I think I just got carried away with the last few patches :(.

Is this Nick Krause? An email reply that Martin forwarded but the list didn't pick up (because it had a html part) suggests this. What you're doing is what got you banned from LKML the last time: sending patches without evidence there's a problem or understanding the code you're patching. Repeating the behaviour under a new identity isn't going to help improve your standing.

James

#8 lore raw
Quoted 108 lines · James Bottomley
Quoted 102 lines · Bastien Philbert
Quoted 100 lines · James Bottomley
Quoted 76 lines · Bastien Philbert
Quoted 74 lines · James Bottomley
Quoted 56 lines · Bastien Philbert
Quoted 54 lines · Julian Calaby

Hi Bastien,

Quoted 30 lines · Bastien Philbert

This fixes backwards locking in the function __csio_unreg_rnode
to
properly lock before the call to the function csio_unreg_rnode
and
not unlock with spin_unlock_irq as this would not allow the
proper
protection for concurrent access on the shared csio_hw structure
pointer hw. In addition switch the locking after the critical
region
function call to properly unlock instead with spin_unlock_irq
on

Signed-off-by: Bastien Philbert <
[email protected]>

---
 drivers/scsi/csiostor/csio_rnode.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/scsi/csiostor/csio_rnode.c +0 -0
index e9c3b04..029a09e 100644

drivers/scsi/csiostor/csio_rnode.c __csio_unreg_rnode(struct csio_rnode · line 586

Quoted 9 lines
drivers/scsi/csiostor/csio_rnode.c +2 -2
@@ -580,9 +580,9 @@ __csio_unreg_rnode(struct csio_rnode
 *rn)
                ln->last_scan_ntgts--;
        }
 
-       spin_unlock_irq(&hw->lock);
-       csio_unreg_rnode(rn);
        spin_lock_irq(&hw->lock);
+       csio_unreg_rnode(rn);
+       spin_unlock_irq(&hw->lock);

Are you _certain_ this is correct? This construct usually appears
when
a function has a particular lock held, then needs to unlock it
to
call
some other function. Are you _certain_ that this isn't the case?

Quoted 8 lines
Quoted 2 lines

Thanks,

Yes I am pretty certain this is correct. I checked the paths that
called this function
and it was weired that none of them gradded the spinlock before
hand.

That's not good enough. If your theory is correct, lockdep should
be
dropping an already unlocked assertion in this codepath ... do you
see
this?

Quoted 4 lines
Quoted 3 lines

James

Yes I do.

You mean you don't see the lockdep assert, since you're asking to drop the patch?

Quoted 2 lines

For now just drop the patch but I am still concerned that we are
double unlocking here.

Really, no. The pattern in the code indicates the lock is expected to be held. This can be wrong (sometimes code moves or people forget), but if it is wrong we'll get an assert about unlock of an already unlocked lock. If there's no assert, the lock is held on entry and the code is correct.

You're proposing patches based on misunderstandings of the code which aren't backed up by actual issues and wasting everyone's time to look at them. Please begin with the hard evidence of a problem first, so post the lockdep assert in the changelog so we know there's a real problem.

Quoted 4 lines
Quoted 2 lines

James

Certainly James. I think I just got carried away with the last few patches :(.

Quoted 9 lines

Is this Nick Krause? An email reply that Martin forwarded but the list didn't pick up (because it had a html part) suggests this. What you're doing is what got you banned from LKML the last time: sending patches without evidence there's a problem or understanding the code you're patching. Repeating the behaviour under a new identity isn't going to help improve your standing.

James

No I am not Nick Krause. I am just aware of how he got banned a few years ago. That email was a mistake by typo and was hoping nobody picked it up as they would then believe I was Nick Krause.
Bastien

#9 lore raw
Quoted 133 lines · Bastien Philbert
Quoted 131 lines · James Bottomley
Quoted 117 lines · Bastien Philbert
Quoted 115 lines · James Bottomley
Quoted 84 lines · Bastien Philbert
Quoted 82 lines · James Bottomley
Quoted 64 lines · Bastien Philbert
Quoted 60 lines · Julian Calaby

Hi Bastien,

Quoted 37 lines · Bastien Philbert

This fixes backwards locking in the function __csio_unreg_rnode
to
properly lock before the call to the function csio_unreg_rnode
and
not unlock with spin_unlock_irq as this would not allow
the
proper
protection for concurrent access on the shared csio_hw
structure
pointer hw. In addition switch the locking after the critical
region
function call to properly unlock instead with spin_unlock_irq
on

Signed-off-by: Bastien Philbert <
[email protected]>

---
 drivers/scsi/csiostor/csio_rnode.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/scsi/csiostor/csio_rnode.c +0 -0
index e9c3b04..029a09e 100644
@@ -580,9 +580,9 @@ __csio_unreg_rnode(struct

csio_rnode
*rn)

                ln->last_scan_ntgts--;
        }

drivers/scsi/csiostor/csio_rnode.c

Quoted 5 lines
drivers/scsi/csiostor/csio_rnode.c +2 -2
-       spin_unlock_irq(&hw->lock);
-       csio_unreg_rnode(rn);
        spin_lock_irq(&hw->lock);
+       csio_unreg_rnode(rn);
+       spin_unlock_irq(&hw->lock);

Are you _certain_ this is correct? This construct usually
appears
when
a function has a particular lock held, then needs to unlock
it
to
call
some other function. Are you _certain_ that this isn't the
case?

Quoted 2 lines

Thanks,

Quoted 7 lines

Yes I am pretty certain this is correct. I checked the paths
that
called this function
and it was weired that none of them gradded the spinlock before
hand.

That's not good enough. If your theory is correct, lockdep should
be
dropping an already unlocked assertion in this codepath ... do
you
see
this?

Quoted 4 lines
Quoted 3 lines

James

Yes I do.

You mean you don't see the lockdep assert, since you're asking to
drop the patch?

Quoted 3 lines

For now just drop the patch but I am still concerned that we
are
double unlocking here.

Really, no. The pattern in the code indicates the lock is expected
to be held. This can be wrong (sometimes code moves or people forget), but if it is wrong we'll get an assert about unlock of an
already unlocked lock. If there's no assert, the lock is held on
entry and the code is correct.

You're proposing patches based on misunderstandings of the code which aren't backed up by actual issues and wasting everyone's time
to look at them. Please begin with the hard evidence of a problem
first, so post the lockdep assert in the changelog so we know there's a real problem.

Quoted 5 lines
Quoted 2 lines

James

Certainly James. I think I just got carried away with the last few
patches :(.

Is this Nick Krause? An email reply that Martin forwarded but the list didn't pick up (because it had a html part) suggests this.
What you're doing is what got you banned from LKML the last time:
sending patches without evidence there's a problem or understanding the code you're patching. Repeating the behaviour under a new identity isn't going to help improve your standing.

Quoted 5 lines
Quoted 2 lines

James

No I am not Nick Krause. I am just aware of how he got banned a few years ago. That email was a mistake by typo and was hoping nobody picked it up as they would then believe I was Nick Krause.

Hm, OK, but currently you are repeating his behaviour ... please don't send any more patches until they're about real problems backed by actual data.

Thanks,

James

#10 lore raw
Quoted 140 lines · James Bottomley
Quoted 133 lines · Bastien Philbert
Quoted 131 lines · James Bottomley
Quoted 117 lines · Bastien Philbert
Quoted 115 lines · James Bottomley
Quoted 84 lines · Bastien Philbert
Quoted 82 lines · James Bottomley
Quoted 64 lines · Bastien Philbert
Quoted 60 lines · Julian Calaby

Hi Bastien,

Quoted 37 lines · Bastien Philbert

This fixes backwards locking in the function __csio_unreg_rnode
to
properly lock before the call to the function csio_unreg_rnode
and
not unlock with spin_unlock_irq as this would not allow
the
proper
protection for concurrent access on the shared csio_hw
structure
pointer hw. In addition switch the locking after the critical
region
function call to properly unlock instead with spin_unlock_irq
on

Signed-off-by: Bastien Philbert <
[email protected]>

---
 drivers/scsi/csiostor/csio_rnode.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/scsi/csiostor/csio_rnode.c +0 -0
index e9c3b04..029a09e 100644
@@ -580,9 +580,9 @@ __csio_unreg_rnode(struct

csio_rnode
*rn)

                ln->last_scan_ntgts--;
        }

drivers/scsi/csiostor/csio_rnode.c

Quoted 5 lines
drivers/scsi/csiostor/csio_rnode.c +2 -2
-       spin_unlock_irq(&hw->lock);
-       csio_unreg_rnode(rn);
        spin_lock_irq(&hw->lock);
+       csio_unreg_rnode(rn);
+       spin_unlock_irq(&hw->lock);

Are you _certain_ this is correct? This construct usually
appears
when
a function has a particular lock held, then needs to unlock
it
to
call
some other function. Are you _certain_ that this isn't the
case?

Quoted 2 lines

Thanks,

Quoted 7 lines

Yes I am pretty certain this is correct. I checked the paths
that
called this function
and it was weired that none of them gradded the spinlock before
hand.

That's not good enough. If your theory is correct, lockdep should
be
dropping an already unlocked assertion in this codepath ... do
you
see
this?

Quoted 4 lines
Quoted 3 lines

James

Yes I do.

You mean you don't see the lockdep assert, since you're asking to
drop the patch?

Quoted 3 lines

For now just drop the patch but I am still concerned that we
are
double unlocking here.

Really, no. The pattern in the code indicates the lock is expected
to be held. This can be wrong (sometimes code moves or people forget), but if it is wrong we'll get an assert about unlock of an
already unlocked lock. If there's no assert, the lock is held on
entry and the code is correct.

You're proposing patches based on misunderstandings of the code which aren't backed up by actual issues and wasting everyone's time
to look at them. Please begin with the hard evidence of a problem
first, so post the lockdep assert in the changelog so we know there's a real problem.

Quoted 5 lines
Quoted 2 lines

James

Certainly James. I think I just got carried away with the last few
patches :(.

Is this Nick Krause? An email reply that Martin forwarded but the list didn't pick up (because it had a html part) suggests this.
What you're doing is what got you banned from LKML the last time:
sending patches without evidence there's a problem or understanding the code you're patching. Repeating the behaviour under a new identity isn't going to help improve your standing.

Quoted 5 lines
Quoted 2 lines

James

No I am not Nick Krause. I am just aware of how he got banned a few years ago. That email was a mistake by typo and was hoping nobody picked it up as they would then believe I was Nick Krause.

Quoted 9 lines

Hm, OK, but currently you are repeating his behaviour ... please don't send any more patches until they're about real problems backed by actual data.

Thanks,

James

Ok sure I do have one patch that I tested and it worked for me but wasn't sure if I am just trampling over the actual bug. If you would like me to send the patch and you can tell me if I am right please let me known.
Sorry about the other patches,
Bastien

#11 lore raw
In reply to James Bottomley
Quoted 136 lines · James Bottomley
Quoted 135 lines · Bastien Philbert
Quoted 133 lines · James Bottomley
Quoted 117 lines · Bastien Philbert
Quoted 115 lines · James Bottomley
Quoted 84 lines · Bastien Philbert
Quoted 82 lines · James Bottomley
Quoted 64 lines · Bastien Philbert
Quoted 60 lines · Julian Calaby

Hi Bastien,

Quoted 37 lines · Bastien Philbert

This fixes backwards locking in the function __csio_unreg_rnode
to
properly lock before the call to the function csio_unreg_rnode
and
not unlock with spin_unlock_irq as this would not allow
the
proper
protection for concurrent access on the shared csio_hw
structure
pointer hw. In addition switch the locking after the critical
region
function call to properly unlock instead with spin_unlock_irq
on

Signed-off-by: Bastien Philbert <
[email protected]>

---
 drivers/scsi/csiostor/csio_rnode.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/scsi/csiostor/csio_rnode.c +0 -0
index e9c3b04..029a09e 100644
@@ -580,9 +580,9 @@ __csio_unreg_rnode(struct

csio_rnode
*rn)

                ln->last_scan_ntgts--;
        }

drivers/scsi/csiostor/csio_rnode.c

Quoted 5 lines
drivers/scsi/csiostor/csio_rnode.c +2 -2
-       spin_unlock_irq(&hw->lock);
-       csio_unreg_rnode(rn);
        spin_lock_irq(&hw->lock);
+       csio_unreg_rnode(rn);
+       spin_unlock_irq(&hw->lock);

Are you _certain_ this is correct? This construct usually
appears
when
a function has a particular lock held, then needs to unlock
it
to
call
some other function. Are you _certain_ that this isn't the
case?

Quoted 2 lines

Thanks,

Quoted 7 lines

Yes I am pretty certain this is correct. I checked the paths
that
called this function
and it was weired that none of them gradded the spinlock before
hand.

That's not good enough. If your theory is correct, lockdep should
be
dropping an already unlocked assertion in this codepath ... do
you
see
this?

Quoted 4 lines
Quoted 3 lines

James

Yes I do.

You mean you don't see the lockdep assert, since you're asking to
drop the patch?

Quoted 3 lines

For now just drop the patch but I am still concerned that we
are
double unlocking here.

Really, no. The pattern in the code indicates the lock is expected
to be held. This can be wrong (sometimes code moves or people forget), but if it is wrong we'll get an assert about unlock of an
already unlocked lock. If there's no assert, the lock is held on
entry and the code is correct.

You're proposing patches based on misunderstandings of the code which aren't backed up by actual issues and wasting everyone's time
to look at them. Please begin with the hard evidence of a problem
first, so post the lockdep assert in the changelog so we know there's a real problem.

Quoted 5 lines
Quoted 2 lines

James

Certainly James. I think I just got carried away with the last few
patches :(.

Is this Nick Krause? An email reply that Martin forwarded but the list didn't pick up (because it had a html part) suggests this.
What you're doing is what got you banned from LKML the last time:
sending patches without evidence there's a problem or understanding the code you're patching. Repeating the behaviour under a new identity isn't going to help improve your standing.

James

Quoted 7 lines
Quoted 3 lines

No I am not Nick Krause. I am just aware of how he got banned a few years ago. That email was a mistake by typo and was hoping nobody picked it up as they would then believe I was Nick Krause.

Hm, OK, but currently you are repeating his behaviour ... please don't send any more patches until they're about real problems backed by actual data.

He's Nick, look at the email headers for proof.

James, and everyone else, please drop his patches. I'll go get him banned from vger again.

Nick, please stop, you have violated the DCO now, a much worse thing than before.

greg k-h

#12 lore raw
Quoted 15 lines · Greg KH
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

Is this Nick Krause? An email reply that Martin forwarded but the list didn't pick up (because it had a html part) suggests this.
What you're doing is what got you banned from LKML the last time:
sending patches without evidence there's a problem or understanding the code you're patching. Repeating the behaviour under a new identity isn't going to help improve your standing.

Quoted 7 lines
Quoted 3 lines

No I am not Nick Krause. I am just aware of how he got banned a few years ago. That email was a mistake by typo and was hoping nobody picked it up as they would then believe I was Nick Krause.

Hm, OK, but currently you are repeating his behaviour ... please don't send any more patches until they're about real problems backed by actual data.

Quoted 7 lines

He's Nick, look at the email headers for proof.

James, and everyone else, please drop his patches. I'll go get him banned from vger again.

Nick, please stop, you have violated the DCO now, a much worse thing than before.

Even if Bastien is going to try to claim that he happens to live in the same house as Nick, the following two patches clearly shows that even if Bastien is violating the DCO by using a fake sock puppet, he's violated the DCO by failing to give Nick credit for writing the identical patch.

- Ted