summaryrefslogtreecommitdiffstats
path: root/fs/erofs/namei.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 10:10:18 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 10:10:18 +0000
commitc6fca85f2153de8b2451269de43abcc2aa0213ab (patch)
treeba8548f2df113c7da8a46563947536f455f9a1c0 /fs/erofs/namei.c
parentAdding debian version 6.1.76-1. (diff)
downloadlinux-c6fca85f2153de8b2451269de43abcc2aa0213ab.tar.xz
linux-c6fca85f2153de8b2451269de43abcc2aa0213ab.zip
Merging upstream version 6.1.82.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'fs/erofs/namei.c')
-rw-r--r--fs/erofs/namei.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/fs/erofs/namei.c b/fs/erofs/namei.c
index 0dc347210..e8ccaa761 100644
--- a/fs/erofs/namei.c
+++ b/fs/erofs/namei.c
@@ -137,24 +137,24 @@ static void *find_target_block_classic(struct erofs_buf *target,
/* string comparison without already matched prefix */
diff = erofs_dirnamecmp(name, &dname, &matched);
- if (!diff) {
- *_ndirents = 0;
- goto out;
- } else if (diff > 0) {
- head = mid + 1;
- startprfx = matched;
-
- if (!IS_ERR(candidate))
- erofs_put_metabuf(target);
- *target = buf;
- candidate = de;
- *_ndirents = ndirents;
- } else {
+ if (diff < 0) {
erofs_put_metabuf(&buf);
-
back = mid - 1;
endprfx = matched;
+ continue;
+ }
+
+ if (!IS_ERR(candidate))
+ erofs_put_metabuf(target);
+ *target = buf;
+ if (!diff) {
+ *_ndirents = 0;
+ return de;
}
+ head = mid + 1;
+ startprfx = matched;
+ candidate = de;
+ *_ndirents = ndirents;
continue;
}
out: /* free if the candidate is valid */