public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: "Jason A. Donenfeld" <Jason@zx2c4.com>
Cc: LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] random: convert to using fops->write_iter()
Date: Thu, 19 May 2022 18:32:40 -0600	[thread overview]
Message-ID: <35b87349-d60a-cc97-5dfe-1eb42ffb432b@kernel.dk> (raw)
In-Reply-To: <YobePA1M0htNbTRN@zx2c4.com>

On 5/19/22 6:18 PM, Jason A. Donenfeld wrote:
> Hi Jens,
> 
> On Thu, May 19, 2022 at 05:43:15PM -0600, Jens Axboe wrote:
>> +	while (iov_iter_count(iter)) {
>> +		block_len = min(iov_iter_count(iter), sizeof(block));
> 
> Whereas get_random_bytes_user() used a separate len param, it looks like
> this function is using iov's len. Maybe that's not such a bad idea? I'll
> give a shot at fixing that up in both places, and you can tell me what
> you think.

Yes that'd be fine, it's just reading iter->count anyway. Agree that
it'd be nicer to just kill the separate 'len' as the copy advances the
iter anyway.

-- 
Jens Axboe


  reply	other threads:[~2022-05-20  0:32 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-19 23:43 [PATCH] random: convert to using fops->write_iter() Jens Axboe
2022-05-19 23:52 ` Jens Axboe
2022-05-20  0:08 ` Jason A. Donenfeld
2022-05-20  0:32   ` Jens Axboe
2022-05-20  0:18 ` Jason A. Donenfeld
2022-05-20  0:32   ` Jens Axboe [this message]
2022-05-20  3:01 ` Al Viro
2022-05-20  3:25   ` Jens Axboe
2022-05-20  3:31     ` Al Viro

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=35b87349-d60a-cc97-5dfe-1eb42ffb432b@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=Jason@zx2c4.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox