Skip to content
Snippets Groups Projects
Commit 032d5a20 authored by Jan Kara's avatar Jan Kara Committed by Frieder Schrempf
Browse files

udf: Fix directory iteration for longer tail extents


commit 1ea1cd11 upstream.

When directory's last extent has more that one block and its length is
not multiple of a block side, the code wrongly decided to move to the
next extent instead of processing the last partial block. This led to
directory corruption. Fix the rounding issue.

Signed-off-by: default avatarJan Kara <jack@suse.cz>
Cc: Shreenidhi Shedi <yesshedi@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 6ade8c0d
No related branches found
No related tags found
1 merge request!180🤖 Sync Bot: Update v6.1-ktn to Latest Stable Kernel (v6.1.124)
...@@ -170,7 +170,7 @@ static struct buffer_head *udf_fiiter_bread_blk(struct udf_fileident_iter *iter) ...@@ -170,7 +170,7 @@ static struct buffer_head *udf_fiiter_bread_blk(struct udf_fileident_iter *iter)
static int udf_fiiter_advance_blk(struct udf_fileident_iter *iter) static int udf_fiiter_advance_blk(struct udf_fileident_iter *iter)
{ {
iter->loffset++; iter->loffset++;
if (iter->loffset < iter->elen >> iter->dir->i_blkbits) if (iter->loffset < DIV_ROUND_UP(iter->elen, 1<<iter->dir->i_blkbits))
return 0; return 0;
iter->loffset = 0; iter->loffset = 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment