* [PATCH] efs: fix direct extent lookup for indirect extents
@ 2026-06-18 19:30 Keshav Verma
2026-06-18 21:19 ` Matthew Wilcox
0 siblings, 1 reply; 3+ messages in thread
From: Keshav Verma @ 2026-06-18 19:30 UTC (permalink / raw)
To: Christian Brauner
Cc: Jan Kara, Mateusz Guzik, Chuck Lever, Jeff Layton, Keshav Verma,
linux-fsdevel, linux-kernel
The loop that finds the direct extent containing an indirect extent used
cur < ibase as its condition. Since ibase starts at zero, the loop never
advances for normal non-negative cur values, so only the first direct
extent is considered.
Iterate over the direct extents and stop when cur falls within the range
covered by the current direct extent.
Signed-off-by: Keshav Verma <iganschel@gmail.com>
---
fs/efs/inode.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/fs/efs/inode.c b/fs/efs/inode.c
index 4b132729e638..16b5ee10e323 100644
--- a/fs/efs/inode.c
+++ b/fs/efs/inode.c
@@ -254,9 +254,14 @@ efs_block_t efs_map_block(struct inode *inode, efs_block_t block) {
*
*/
ibase = 0;
- for(dirext = 0; cur < ibase && dirext < direxts; dirext++) {
- ibase += in->extents[dirext].cooked.ex_length *
+ for (dirext = 0; dirext < direxts; dirext++) {
+ int entries = in->extents[dirext].cooked.ex_length *
(EFS_BLOCKSIZE / sizeof(efs_extent));
+
+ if (cur < ibase + entries)
+ break;
+
+ ibase += entries;
}
if (dirext == direxts) {
--
2.39.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] efs: fix direct extent lookup for indirect extents
2026-06-18 19:30 [PATCH] efs: fix direct extent lookup for indirect extents Keshav Verma
@ 2026-06-18 21:19 ` Matthew Wilcox
2026-06-18 21:27 ` Keshav Verma
0 siblings, 1 reply; 3+ messages in thread
From: Matthew Wilcox @ 2026-06-18 21:19 UTC (permalink / raw)
To: Keshav Verma
Cc: Christian Brauner, Jan Kara, Mateusz Guzik, Chuck Lever,
Jeff Layton, linux-fsdevel, linux-kernel
On Fri, Jun 19, 2026 at 01:00:05AM +0530, Keshav Verma wrote:
> The loop that finds the direct extent containing an indirect extent used
> cur < ibase as its condition. Since ibase starts at zero, the loop never
> advances for normal non-negative cur values, so only the first direct
> extent is considered.
>
> Iterate over the direct extents and stop when cur falls within the range
> covered by the current direct extent.
Nah.
https://lore.kernel.org/linux-fsdevel/20260618211822.3599089-1-willy@infradead.org/
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] efs: fix direct extent lookup for indirect extents
2026-06-18 21:19 ` Matthew Wilcox
@ 2026-06-18 21:27 ` Keshav Verma
0 siblings, 0 replies; 3+ messages in thread
From: Keshav Verma @ 2026-06-18 21:27 UTC (permalink / raw)
To: Matthew Wilcox
Cc: Christian Brauner, Jan Kara, Mateusz Guzik, Chuck Lever,
Jeff Layton, linux-fsdevel, linux-kernel
On Fri, Jun 19, 2026 at 2:49 AM Matthew Wilcox <willy@infradead.org> wrote:
>
>
> Nah.
>
> https://lore.kernel.org/linux-fsdevel/20260618211822.3599089-1-willy@infradead.org/
Thanks, I missed your EFS removal patch.
I'll drop this one.
Thanks,
Keshav
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-06-18 21:27 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-18 19:30 [PATCH] efs: fix direct extent lookup for indirect extents Keshav Verma
2026-06-18 21:19 ` Matthew Wilcox
2026-06-18 21:27 ` Keshav Verma
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.