From: Matthew Wilcox <willy@infradead.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: David Sterba <dsterba@suse.com>, David Sterba <dsterba@suse.cz>,
linux-btrfs <linux-btrfs@vger.kernel.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [GIT PULL] Btrfs updates for 5.13
Date: Mon, 26 Apr 2021 22:07:30 +0100 [thread overview]
Message-ID: <20210426210730.GR235567@casper.infradead.org> (raw)
In-Reply-To: <CAHk-=wj1KRvb=hie1VUTGo1D_ckD+Suo0-M2Nh5Kek1Wu=2Ppw@mail.gmail.com>
On Mon, Apr 26, 2021 at 01:55:03PM -0700, Linus Torvalds wrote:
> I've pulled this, but:
>
> On Mon, Apr 26, 2021 at 1:01 PM David Sterba <dsterba@suse.com> wrote:
> >
> > Matthew Wilcox (Oracle) (1):
> > btrfs: add and use readahead_batch_length
>
> This one is buggy, or at least questionable.
>
> Yes, yes, the function looks trivial. That doesn't make it right:
>
> static inline loff_t readahead_batch_length(struct readahead_control *rac)
> {
> return rac->_batch_count * PAGE_SIZE;
> }
>
> the above does not get the types right, and silently does different
> typecasting than the code clearly intends from the return type of the
> function.
>
> It may not matter much in practice, but it's still wrong.
Thanks. You're right that it doesn't matter in practice (because a
batch length is always much, much less than 4GB), but I'll fix it to
return a size_t (which is just the obvious s/loff_t/size_t/, because
PAGE_SIZE is an unsigned long).
next prev parent reply other threads:[~2021-04-26 21:07 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-26 19:59 David Sterba
2021-04-26 20:55 ` Linus Torvalds
2021-04-26 21:07 ` Matthew Wilcox [this message]
2021-04-26 20:57 ` pr-tracker-bot
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=20210426210730.GR235567@casper.infradead.org \
--to=willy@infradead.org \
--cc=dsterba@suse.com \
--cc=dsterba@suse.cz \
--cc=linux-btrfs@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@linux-foundation.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
all inboxes | Powered by JetHome®