nvme: precedence bug in nvme_pr_clear()
Subsystems (2)
PATCH 1/1 nvme: precedence bug in nvme_pr_clear()
The "|" operator has higher precedence than "?:" so this didn't work as intended. I had previously fixed this bug, but it we copied the older unfixed version when we moved the function between files.
drivers/nvme/host/core.c +1 -1
@@ -671,7 +671,7 @@ static int nvme_pr_preempt(struct block_device *bdev, u64 old, u64 new,static int nvme_pr_clear (struct block_device *bdev,u64 key) { -u32 cdw10 =1 | key ?1 <<3 :0 ; +u32 cdw10 =1 | (key ?1 <<3 :0 );return nvme_pr_command (bdev, cdw10, key,0 , nvme_cmd_resv_register); }
Quoted 6 lines · Dan Carpenter
The "|" operator has higher precedence than "?:" so this didn't work as intended. I had previously fixed this bug, but it we copied the older unfixed version when we moved the function between files.
Fixes 1673f1f08c88 ('nvme: move block_device_operations and ns/ctrl freeing to common code')Signed-off-by Dan Carpenter <[email protected]>
Dejavu, but I guess in a different function. Christoph, you are hereby banned from ever using ?:!
Signature · 1 line
Jens Axboe
Christoph Hellwig
maintainerQuoted 10 lines · Jens Axboe
Quoted 6 lines · Dan Carpenter
The "|" operator has higher precedence than "?:" so this didn't work as intended. I had previously fixed this bug, but it we copied the older unfixed version when we moved the function between files.
Fixes 1673f1f08c88 ('nvme: move block_device_operations and ns/ctrl freeing to common code')Signed-off-by Dan Carpenter <[email protected]>Dejavu, but I guess in a different function. Christoph, you are hereby banned from ever using ?:!
Nah, I'm banned from ever moving large chunks of code around again :) The orginal Bug is Keith's, I just undid the fix by not properly fixing up the code move for the conflict.
Quoted 10 lines · Jens Axboe
Quoted 6 lines · Dan Carpenter
The "|" operator has higher precedence than "?:" so this didn't work as intended. I had previously fixed this bug, but it we copied the older unfixed version when we moved the function between files.
Fixes 1673f1f08c88 ('nvme: move block_device_operations and ns/ctrl freeing to common code')Signed-off-by Dan Carpenter <[email protected]>Dejavu, but I guess in a different function. Christoph, you are hereby banned from ever using ?:!
Ah, that came from me. I wrote the patch on one machine, tested on another. The tests required those issues be fixed, but the fixes didn't propgate back to the original machine that generated the patch.
git user fail...
Quoted 9 lines · Christoph Hellwig
Quoted 8 lines · Jens Axboe
Quoted 6 lines · Dan Carpenter
The "|" operator has higher precedence than "?:" so this didn't work as intended. I had previously fixed this bug, but it we copied the older unfixed version when we moved the function between files.
Fixes 1673f1f08c88 ('nvme: move block_device_operations and ns/ctrl freeing to common code')Signed-off-by Dan Carpenter <[email protected]>
Quoted 6 lines
Quoted 2 lines
Dejavu, but I guess in a different function. Christoph, you are hereby banned from ever using ?:!
Nah, I'm banned from ever moving large chunks of code around again :) The orginal Bug is Keith's, I just undid the fix by not properly fixing up the code move for the conflict.
Alright you are off the hook, the ban will be instated in Keith instead :-)
Signature · 1 line
Jens Axboe
Quoted 10 lines · Jens Axboe
Quoted 6 lines · Dan Carpenter
The "|" operator has higher precedence than "?:" so this didn't work as intended. I had previously fixed this bug, but it we copied the older unfixed version when we moved the function between files.
Fixes 1673f1f08c88 ('nvme: move block_device_operations and ns/ctrl freeing to common code')Signed-off-by Dan Carpenter <[email protected]>Dejavu, but I guess in a different function. Christoph, you are hereby banned from ever using ?:!
Christoph didn't write this. I think where it went wrong is:
[Moved the integrity and pr changes due to merge conflict]
We merged the buggy version instead of the fixed version. I don't know git well enough to be positive.
regards,
dan carpenter
Quoted 2 lines · Jens Axboe
Alright you are off the hook, the ban will be instated in Keith instead :-)
*humbled*
;)