Re: [PATCH] scsi: t10-pi: Return correct ref tag when queue has no integrity profile

2018-12-06 Thread chenxiang (M)
Hi, 在 2018/12/6 20:04, John Garry 写道: On 06/12/2018 04:17, Martin K. Petersen wrote: + Bart, Had you considered to use lower_32_bits() instead of "0x"? That would to avoid that reviewers have to count the 'f'-s to verify correctness of t10_pi_ref_tag(). I hadn't. I guess I tend

Re: [PATCH] scsi: t10-pi: Return correct ref tag when queue has no integrity profile

2018-12-06 Thread John Garry
On 06/12/2018 04:17, Martin K. Petersen wrote: + Bart, Had you considered to use lower_32_bits() instead of "0x"? That would to avoid that reviewers have to count the 'f'-s to verify correctness of t10_pi_ref_tag(). I hadn't. I guess I tend to think of lower_32_bits() as something

Re: [PATCH] scsi: t10-pi: Return correct ref tag when queue has no integrity profile

2018-12-05 Thread Martin K. Petersen
Bart, > Had you considered to use lower_32_bits() instead of "0x"? > That would to avoid that reviewers have to count the 'f'-s to verify > correctness of t10_pi_ref_tag(). I hadn't. I guess I tend to think of lower_32_bits() as something you do to pointers, not to block numbers. --

Re: [PATCH] scsi: t10-pi: Return correct ref tag when queue has no integrity profile

2018-12-05 Thread Bart Van Assche
On 12/5/18 6:04 AM, Martin K. Petersen wrote: Since the return value of this function is 'u32', can the ' & 0x' be left out? Absolutely, and I almost zapped it. However, I decided to leave it to emphasize the point that the reference tag is truncated to a 32-bit value. To me, this is

Re: [PATCH] scsi: t10-pi: Return correct ref tag when queue has no integrity profile

2018-12-05 Thread Martin K. Petersen
Hi Bart, > Since the return value of this function is 'u32', can the ' & > 0x' be left out? Absolutely, and I almost zapped it. However, I decided to leave it to emphasize the point that the reference tag is truncated to a 32-bit value. To me, this is more obvious than having to

Re: [PATCH] scsi: t10-pi: Return correct ref tag when queue has no integrity profile

2018-12-04 Thread Bart Van Assche
On 12/4/18 6:31 PM, Martin K. Petersen wrote: Commit ddd0bc756983 ("block: move ref_tag calculation func to the block layer") moved ref tag calculation from SCSI to a library function. However, this change broke returning the correct ref tag for devices operating in DIF mode since these do not

[PATCH] scsi: t10-pi: Return correct ref tag when queue has no integrity profile

2018-12-04 Thread Martin K. Petersen
Commit ddd0bc756983 ("block: move ref_tag calculation func to the block layer") moved ref tag calculation from SCSI to a library function. However, this change broke returning the correct ref tag for devices operating in DIF mode since these do not have an associated block integrity profile. This