Commit 1ea1cd11 authored by Jan Kara's avatar Jan Kara
Browse files

udf: Fix directory iteration for longer tail extents



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>
parent ee454ad2
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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)
{
	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;

	iter->loffset = 0;