mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-03 19:26:01 -04:00
NVMe: Precedence error in nvme_pr_clear()
The original code is equivalent to:
u32 cdw10 = (1 | key) ? 1 << 3 : 0;
But we want:
u32 cdw10 = 1 | (key ? 1 << 3 : 0);
Fixes: 1d277a637a: ('NVMe: Add persistent reservation ops')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
This commit is contained in:
committed by
Jens Axboe
parent
a6dd1020d8
commit
73fcf4e20e
@@ -2136,7 +2136,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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user