From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E60D32DC328 for ; Mon, 20 Oct 2025 08:09:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760947745; cv=none; b=fL0M3mRZIGlFI871m/xllnCTB2UAwL5CtpY3tbQEuv+J4Q5RUS4UzRlb2KTU8SjhGCTW7eLAX8WIIesk8U07YBBhfUMyVyQc6AizXYSrlDePjGUjwiiXz7t+GIR9/uQh4LzzFoaMtKcx0xRzPj+8T6SyL3bvHx6yfKMlzxkx2m8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760947745; c=relaxed/simple; bh=nYmzORq0HNJRnqA4k+RWC7pTwGafV22NR9UaHT/3cHg=; h=Subject:To:Cc:From:Date:Message-ID:MIME-Version:Content-Type; b=niMx/Ma1x1yRGfBjHf3JRbJ7/v1QIqW0PDak+5ws722Epd7r5QuhrEwERqtOrsww8GDBLyPo7dX5DaU5JmqARzPspngv4xFfjQhsz/HZpt+YLOVpDHd5qtSKb2HSlu4TktQWfCBsZS8aoVSSEIHPCHoflZUTLmShjpb+MjBKMEM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=ORFYufg2; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="ORFYufg2" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 19C38C4CEF9; Mon, 20 Oct 2025 08:09:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1760947744; bh=nYmzORq0HNJRnqA4k+RWC7pTwGafV22NR9UaHT/3cHg=; h=Subject:To:Cc:From:Date:From; b=ORFYufg2UFEWfz3b4syZChiYihtUsr0MKMhzVBVvzdEFY2p0glsG8Q7fzS6Gcx9E2 Yar+VESuwJbkngcnAFrhXqIim63J2BM2raFcqZyoaI8cyWVzLtEQKCG1RMOWo84d8F h2e2H8nDAqVC8YZapH6cgePb57mxCWw7ELj/Jook= Subject: FAILED: patch "[PATCH] f2fs: fix wrong block mapping for multi-devices" failed to apply to 5.15-stable tree To: jaegeuk@kernel.org Cc: From: Date: Mon, 20 Oct 2025 10:08:53 +0200 Message-ID: <2025102053-joylessly-pony-8641@gregkh> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit The patch below does not apply to the 5.15-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . To reproduce the conflict and resubmit, you may use the following commands: git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.15.y git checkout FETCH_HEAD git cherry-pick -x 9d5c4f5c7a2c7677e1b3942772122b032c265aae # git commit -s git send-email --to '' --in-reply-to '2025102053-joylessly-pony-8641@gregkh' --subject-prefix 'PATCH 5.15.y' HEAD^.. Possible dependencies: thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From 9d5c4f5c7a2c7677e1b3942772122b032c265aae Mon Sep 17 00:00:00 2001 From: Jaegeuk Kim Date: Tue, 7 Oct 2025 03:32:30 +0000 Subject: [PATCH] f2fs: fix wrong block mapping for multi-devices Assuming the disk layout as below, disk0: 0 --- 0x00035abfff disk1: 0x00035ac000 --- 0x00037abfff disk2: 0x00037ac000 --- 0x00037ebfff and we want to read data from offset=13568 having len=128 across the block devices, we can illustrate the block addresses like below. 0 .. 0x00037ac000 ------------------- 0x00037ebfff, 0x00037ec000 ------- | ^ ^ ^ | fofs 0 13568 13568+128 | ------------------------------------------------------ | LBA 0x37e8aa9 0x37ebfa9 0x37ec029 --- map 0x3caa9 0x3ffa9 In this example, we should give the relative map of the target block device ranging from 0x3caa9 to 0x3ffa9 where the length should be calculated by 0x37ebfff + 1 - 0x37ebfa9. In the below equation, however, map->m_pblk was supposed to be the original address instead of the one from the target block address. - map->m_len = min(map->m_len, dev->end_blk + 1 - map->m_pblk); Cc: stable@vger.kernel.org Fixes: 71f2c8206202 ("f2fs: multidevice: support direct IO") Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index ef38e62cda8f..775aa4f63aa3 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c @@ -1497,8 +1497,8 @@ static bool f2fs_map_blocks_cached(struct inode *inode, struct f2fs_dev_info *dev = &sbi->devs[bidx]; map->m_bdev = dev->bdev; - map->m_pblk -= dev->start_blk; map->m_len = min(map->m_len, dev->end_blk + 1 - map->m_pblk); + map->m_pblk -= dev->start_blk; } else { map->m_bdev = inode->i_sb->s_bdev; }