[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-btrfs
Subject:    Re: [PATCH v2] btrfs: zoned: fix zone number to sector/physical calculation
From:       David Sterba <dsterba () suse ! cz>
Date:       2021-05-31 18:10:17
Message-ID: 20210531181017.GA31483 () twin ! jikos ! cz
[Download RAW message or body]

On Thu, May 27, 2021 at 03:27:32PM +0900, Naohiro Aota wrote:
> In btrfs_get_dev_zone_info(), we have "u32 sb_zone" and calculate "sector_t
> sector" by shifting it. But, this "sector" is calculated in 32bit, leading
> it to be 0 for the 2nd superblock copy.
> 
> Since zone number is u32, shifting it to sector (sector_t) or physical
> address (u64) can easily trigger a missing cast bug like this.
> 
> This commit introduces helpers to convert zone number to sector/LBA, so we
> won't fall into the same pitfall again.
> 
> Fixes: 12659251ca5d ("btrfs: implement log-structured superblock for ZONED mode")
> Cc: stable@vger.kernel.org # 5.11+
> Reported-by: Dmitry Fomichev <Dmitry.Fomichev@wdc.com>
> Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com>

Added to misc-next, thanks.
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic