Re: virtio-rng only returns zeros with CONFIG_HW_RANDOM=m

Rusty Russell
2013-02-28T03:21:21Z

Jens Axboe <axboe@kernel.dk> writes:
> On Wed, Feb 27 2013, Rusty Russell wrote:
>> Subject: scatterlist: sg_set_buf() argument must be in linear mapping.
>>
>> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
>>
>> diff --git a/include/linux/scatterlist.h b/include/linux/scatterlist.h
>> index 4bd6c06..9365375 100644
>> --- a/include/linux/scatterlist.h
>> +++ b/include/linux/scatterlist.h
>> @@ -111,6 +111,9 @@ static inline struct page *sg_page(struct scatterlist *sg)
>> static inline void sg_set_buf(struct scatterlist *sg, const void *buf,
>> unsigned int buflen)
>> {
>> +#ifdef CONFIG_DEBUG_SG
>> + BUG_ON(!virt_addr_valid(buf));
>> +#endif
>> sg_set_page(sg, virt_to_page(buf), buflen, offset_in_page(buf));
>> }
>
> Looks good to me, in lieu of being able to return an error. Want me to
> queue it up?

Please... it'll catch me the next time I make the same mistake :)

(Though the static-definitions-in-modules-on-most-archs is a pretty
nasty corner case).

Thanks,
Rusty.