lkml.org 
[lkml]   [2020]   [Oct]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH 5/7] btrfs: Promote to unsigned long long before shifting
    On Sun, Oct 04, 2020 at 07:04:26PM +0100, Matthew Wilcox (Oracle) wrote:
    > On 32-bit systems, this shift will overflow for files larger than 4GB.
    >
    > Cc: stable@vger.kernel.org
    > Fixes: df480633b891 ("btrfs: extent-tree: Switch to new delalloc space reserve and release")
    > Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
    > ---
    > fs/btrfs/ioctl.c | 6 +++---
    > 1 file changed, 3 insertions(+), 3 deletions(-)
    >
    > diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
    > index ac45f022b495..4d3b7e4ae53a 100644
    > --- a/fs/btrfs/ioctl.c
    > +++ b/fs/btrfs/ioctl.c
    > @@ -1277,7 +1277,7 @@ static int cluster_pages_for_defrag(struct inode *inode,
    > page_cnt = min_t(u64, (u64)num_pages, (u64)file_end - start_index + 1);
    >
    > ret = btrfs_delalloc_reserve_space(BTRFS_I(inode), &data_reserved,
    > - start_index << PAGE_SHIFT,
    > + (loff_t)start_index << PAGE_SHIFT,

    > - start_index << PAGE_SHIFT,
    > + (loff_t)start_index << PAGE_SHIFT,

    > - start_index << PAGE_SHIFT,
    > + (loff_t)start_index << PAGE_SHIFT,

    As this repeats 3 times I've added a variable. Patch added to misc-next,
    thanks.

    \
     
     \ /
      Last update: 2020-10-26 18:06    [W:2.533 / U:0.020 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site