Patch "erofs: get rid of erofs_inode_datablocks()" has been added to the 6.1-stable tree
gregkh at linuxfoundation.org
gregkh at linuxfoundation.org
Tue Oct 8 21:27:19 AEDT 2024
This is a note to let you know that I've just added the patch titled
erofs: get rid of erofs_inode_datablocks()
to the 6.1-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
erofs-get-rid-of-erofs_inode_datablocks.patch
and it can be found in the queue-6.1 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <stable at vger.kernel.org> know about it.
>From hsiangkao at linux.alibaba.com Tue Oct 8 08:57:30 2024
From: Gao Xiang <hsiangkao at linux.alibaba.com>
Date: Tue, 8 Oct 2024 14:57:04 +0800
Subject: erofs: get rid of erofs_inode_datablocks()
To: stable at vger.kernel.org, Greg Kroah-Hartman <gregkh at linuxfoundation.org>
Cc: linux-erofs at lists.ozlabs.org, LKML <linux-kernel at vger.kernel.org>
Message-ID: <20241008065708.727659-1-hsiangkao at linux.alibaba.com>
From: Gao Xiang <hsiangkao at linux.alibaba.com>
commit 4efdec36dc9907628e590a68193d6d8e5e74d032 upstream.
erofs_inode_datablocks() has the only one caller, let's just get
rid of it entirely. No logic changes.
Reviewed-by: Yue Hu <huyue2 at coolpad.com>
Reviewed-by: Jingbo Xu <jefflexu at linux.alibaba.com>
Reviewed-by: Chao Yu <chao at kernel.org>
Stable-dep-of: 9ed50b8231e3 ("erofs: fix incorrect symlink detection in fast symlink")
Link: https://lore.kernel.org/r/20230204093040.97967-1-hsiangkao@linux.alibaba.com
[ Gao Xiang: apply this to 6.6.y to avoid further backport twists
due to obsoleted EROFS_BLKSIZ. ]
Signed-off-by: Gao Xiang <hsiangkao at linux.alibaba.com>
Signed-off-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
---
Obsoleted EROFS_BLKSIZ impedes efforts to backport
9ed50b8231e3 ("erofs: fix incorrect symlink detection in fast symlink")
9e2f9d34dd12 ("erofs: handle overlapped pclusters out of crafted images properly")
To avoid further bugfix conflicts due to random EROFS_BLKSIZs
around the whole codebase, just backport the dependencies for 6.1.y.
fs/erofs/internal.h | 6 ------
fs/erofs/namei.c | 18 +++++-------------
2 files changed, 5 insertions(+), 19 deletions(-)
--- a/fs/erofs/internal.h
+++ b/fs/erofs/internal.h
@@ -347,12 +347,6 @@ static inline erofs_off_t erofs_iloc(str
(EROFS_I(inode)->nid << sbi->islotbits);
}
-static inline unsigned long erofs_inode_datablocks(struct inode *inode)
-{
- /* since i_size cannot be changed */
- return DIV_ROUND_UP(inode->i_size, EROFS_BLKSIZ);
-}
-
static inline unsigned int erofs_bitrange(unsigned int value, unsigned int bit,
unsigned int bits)
{
--- a/fs/erofs/namei.c
+++ b/fs/erofs/namei.c
@@ -5,7 +5,6 @@
* Copyright (C) 2022, Alibaba Cloud
*/
#include "xattr.h"
-
#include <trace/events/erofs.h>
struct erofs_qstr {
@@ -87,19 +86,13 @@ static struct erofs_dirent *find_target_
return ERR_PTR(-ENOENT);
}
-static void *find_target_block_classic(struct erofs_buf *target,
- struct inode *dir,
- struct erofs_qstr *name,
- int *_ndirents)
+static void *erofs_find_target_block(struct erofs_buf *target,
+ struct inode *dir, struct erofs_qstr *name, int *_ndirents)
{
- unsigned int startprfx, endprfx;
- int head, back;
+ int head = 0, back = DIV_ROUND_UP(dir->i_size, EROFS_BLKSIZ) - 1;
+ unsigned int startprfx = 0, endprfx = 0;
void *candidate = ERR_PTR(-ENOENT);
- startprfx = endprfx = 0;
- head = 0;
- back = erofs_inode_datablocks(dir) - 1;
-
while (head <= back) {
const int mid = head + (back - head) / 2;
struct erofs_buf buf = __EROFS_BUF_INITIALIZER;
@@ -180,8 +173,7 @@ int erofs_namei(struct inode *dir, const
qn.end = name->name + name->len;
ndirents = 0;
-
- de = find_target_block_classic(&buf, dir, &qn, &ndirents);
+ de = erofs_find_target_block(&buf, dir, &qn, &ndirents);
if (IS_ERR(de))
return PTR_ERR(de);
Patches currently in stable-queue which might be from hsiangkao at linux.alibaba.com are
queue-6.1/erofs-set-block-size-to-the-on-disk-block-size.patch
queue-6.1/erofs-avoid-hardcoded-blocksize-for-subpage-block-support.patch
queue-6.1/erofs-fix-incorrect-symlink-detection-in-fast-symlink.patch
queue-6.1/erofs-get-rid-of-z_erofs_do_map_blocks-forward-declaration.patch
queue-6.1/erofs-get-rid-of-erofs_inode_datablocks.patch
More information about the Linux-erofs
mailing list