* [PATCH] [SCSI] sd: set BIO_MAPPED_INTEGRITY bit correctly in sd_dif_prepare().
@ 2012-03-07 14:41 santosh nayak
2012-03-07 15:44 ` Matthew Wilcox
2012-03-07 15:56 ` Matthew Wilcox
0 siblings, 2 replies; 5+ messages in thread
From: santosh nayak @ 2012-03-07 14:41 UTC (permalink / raw)
To: JBottomley; +Cc: linux-scsi, linux-kernel, kernel-janitors, Santosh Nayak
From: Santosh Nayak <santoshprasadnayak@gmail.com>
Value of BIO_MAPPED_INTEGRITY is 11. Intention was to set the 11th bit.
Signed-off-by: Santosh Nayak <santoshprasadnayak@gmail.com>
---
drivers/scsi/sd_dif.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/scsi/sd_dif.c b/drivers/scsi/sd_dif.c
index e981d97..8ccaf53 100644
--- a/drivers/scsi/sd_dif.c
+++ b/drivers/scsi/sd_dif.c
@@ -408,7 +408,7 @@ int sd_dif_prepare(struct request *rq, sector_t hw_sector, unsigned int sector_s
kunmap_atomic(sdt);
}
- bio->bi_flags |= BIO_MAPPED_INTEGRITY;
+ set_bit(BIO_MAPPED_INTEGRITY, &bio->bi_flags);
}
return 0;
--
1.7.4.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] [SCSI] sd: set BIO_MAPPED_INTEGRITY bit correctly in sd_dif_prepare().
2012-03-07 14:41 [PATCH] [SCSI] sd: set BIO_MAPPED_INTEGRITY bit correctly in sd_dif_prepare() santosh nayak
@ 2012-03-07 15:44 ` Matthew Wilcox
2012-03-07 15:56 ` Matthew Wilcox
1 sibling, 0 replies; 5+ messages in thread
From: Matthew Wilcox @ 2012-03-07 15:44 UTC (permalink / raw)
To: santosh nayak; +Cc: JBottomley, linux-scsi, linux-kernel, kernel-janitors
On Wed, Mar 07, 2012 at 08:11:35PM +0530, santosh nayak wrote:
> - bio->bi_flags |= BIO_MAPPED_INTEGRITY;
> + set_bit(BIO_MAPPED_INTEGRITY, &bio->bi_flags);
This uses an atomic operation; you should rather use __set_bit instead.
--
Matthew Wilcox Intel Open Source Technology Centre
"Bill, look, we understand that you're interested in selling us this
operating system, but compare it to ours. We can't possibly take such
a retrograde step."
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] [SCSI] sd: set BIO_MAPPED_INTEGRITY bit correctly in sd_dif_prepare().
2012-03-07 14:41 [PATCH] [SCSI] sd: set BIO_MAPPED_INTEGRITY bit correctly in sd_dif_prepare() santosh nayak
2012-03-07 15:44 ` Matthew Wilcox
@ 2012-03-07 15:56 ` Matthew Wilcox
2012-03-07 15:59 ` santosh prasad nayak
2012-03-07 16:07 ` santosh prasad nayak
1 sibling, 2 replies; 5+ messages in thread
From: Matthew Wilcox @ 2012-03-07 15:56 UTC (permalink / raw)
To: santosh nayak; +Cc: JBottomley, linux-scsi, linux-kernel, kernel-janitors, mkp
On Wed, Mar 07, 2012 at 08:11:35PM +0530, santosh nayak wrote:
> From: Santosh Nayak <santoshprasadnayak@gmail.com>
>
> Value of BIO_MAPPED_INTEGRITY is 11. Intention was to set the 11th bit.
Also, can we introduce:
#define bio_set_flag(bio, flag) ((bio)->bi_flags |= (1 << (flag)))
Then hunt down and kill all the places that manipulate bi_flags by hand?
We might also need:
#define bio_set_flag_atomic(bio, flag) set_bit(&(bio)->bi_flags, (flag))
--
Matthew Wilcox Intel Open Source Technology Centre
"Bill, look, we understand that you're interested in selling us this
operating system, but compare it to ours. We can't possibly take such
a retrograde step."
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] [SCSI] sd: set BIO_MAPPED_INTEGRITY bit correctly in sd_dif_prepare().
2012-03-07 15:56 ` Matthew Wilcox
@ 2012-03-07 15:59 ` santosh prasad nayak
2012-03-07 16:07 ` santosh prasad nayak
1 sibling, 0 replies; 5+ messages in thread
From: santosh prasad nayak @ 2012-03-07 15:59 UTC (permalink / raw)
To: Matthew Wilcox; +Cc: JBottomley, linux-scsi, linux-kernel, kernel-janitors, mkp
Thanks Matthew for your response.
I will resend the patch with required changes.
regards
Santosh
On Wed, Mar 7, 2012 at 9:26 PM, Matthew Wilcox <matthew@wil.cx> wrote:
> On Wed, Mar 07, 2012 at 08:11:35PM +0530, santosh nayak wrote:
>> From: Santosh Nayak <santoshprasadnayak@gmail.com>
>>
>> Value of BIO_MAPPED_INTEGRITY is 11. Intention was to set the 11th bit.
>
> Also, can we introduce:
>
> #define bio_set_flag(bio, flag) ((bio)->bi_flags |= (1 << (flag)))
>
> Then hunt down and kill all the places that manipulate bi_flags by hand?
> We might also need:
>
> #define bio_set_flag_atomic(bio, flag) set_bit(&(bio)->bi_flags, (flag))
>
> --
> Matthew Wilcox Intel Open Source Technology Centre
> "Bill, look, we understand that you're interested in selling us this
> operating system, but compare it to ours. We can't possibly take such
> a retrograde step."
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] [SCSI] sd: set BIO_MAPPED_INTEGRITY bit correctly in sd_dif_prepare().
2012-03-07 15:56 ` Matthew Wilcox
2012-03-07 15:59 ` santosh prasad nayak
@ 2012-03-07 16:07 ` santosh prasad nayak
1 sibling, 0 replies; 5+ messages in thread
From: santosh prasad nayak @ 2012-03-07 16:07 UTC (permalink / raw)
To: Matthew Wilcox; +Cc: JBottomley, linux-scsi, linux-kernel, kernel-janitors, mkp
On Wed, Mar 7, 2012 at 9:26 PM, Matthew Wilcox <matthew@wil.cx> wrote:
> On Wed, Mar 07, 2012 at 08:11:35PM +0530, santosh nayak wrote:
>> From: Santosh Nayak <santoshprasadnayak@gmail.com>
>>
>> Value of BIO_MAPPED_INTEGRITY is 11. Intention was to set the 11th bit.
>
> Also, can we introduce:
>
> #define bio_set_flag(bio, flag) ((bio)->bi_flags |= (1 << (flag)))
>
set_bit() can do the same task.
Can you please explain why do we need a new macro ?
> Then hunt down and kill all the places that manipulate bi_flags by hand?
> We might also need:
>
> #define bio_set_flag_atomic(bio, flag) set_bit(&(bio)->bi_flags, (flag))
for atomic operation we have __set_bit() . Is there any need to define
to new macro ?
Regards
Santosh
>
> --
> Matthew Wilcox Intel Open Source Technology Centre
> "Bill, look, we understand that you're interested in selling us this
> operating system, but compare it to ours. We can't possibly take such
> a retrograde step."
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2012-03-07 16:07 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-07 14:41 [PATCH] [SCSI] sd: set BIO_MAPPED_INTEGRITY bit correctly in sd_dif_prepare() santosh nayak
2012-03-07 15:44 ` Matthew Wilcox
2012-03-07 15:56 ` Matthew Wilcox
2012-03-07 15:59 ` santosh prasad nayak
2012-03-07 16:07 ` santosh prasad nayak
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox