[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZpaW9ebdKyJremzp@casper.infradead.org>
Date: Tue, 16 Jul 2024 16:51:17 +0100
From: Matthew Wilcox <willy@...radead.org>
To: Sergey Shtylyov <s.shtylyov@....ru>
Cc: Roman Smirnov <r.smirnov@....ru>,
Alexander Viro <viro@...iv.linux.org.uk>,
Christian Brauner <brauner@...nel.org>, Jan Kara <jack@...e.cz>,
linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
lvc-project@...uxtesting.org
Subject: Re: [PATCH] fs: buffer: set the expression type to unsigned long in
folio_create_buffers()
On Tue, Jul 16, 2024 at 06:41:49PM +0300, Sergey Shtylyov wrote:
> And here we'll have at least one potential problem (that you neglected
> to describe): with 1 << 31, that 1 will land in a sign bit and then, when
> it's implicitly cast to *unsigned long*, the 32-bit value will be sign-
> extended to 64-bit on 64-bit arches) and then we'll have an incorrect size
> (0xffffffff80000000) passed to create_empty_buffers()...
Tell me more about this block device you have with a 2GB block size ... ?
(ie note that this is a purely theoretical issue)
> > to use 1UL instead.
>
> Perphas was worth noting that using 1UL saves us 1 movsx instruction on
> x86_64...
That is a worthwhile addition to the change log.
Also, you should cc the person who wrote that code, ie me.
Powered by blists - more mailing lists