Skip to content

Commit a64d897

Browse files
jankaragregkh
authored andcommitted
udf: Fix inode_getblk() return value
commit 6afdc60 upstream. Smatch noticed that inode_getblk() can return 1 on successful mapping of a block instead of expected 0 after commit b405c1e ("udf: refactor udf_next_aext() to handle error"). This could confuse some of the callers and lead to strange failures (although the one reported by Smatch in udf_mkdir() is impossible to trigger in practice). Fix the return value of inode_getblk(). Link: https://lore.kernel.org/all/[email protected] Reported-by: Dan Carpenter <[email protected]> Reviewed-by: Carlos Maiolino <[email protected]> Fixes: b405c1e ("udf: refactor udf_next_aext() to handle error") CC: [email protected] Signed-off-by: Jan Kara <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent a5434db commit a64d897

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

fs/udf/inode.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -814,6 +814,7 @@ static int inode_getblk(struct inode *inode, struct udf_map_rq *map)
814814
}
815815
map->oflags = UDF_BLK_MAPPED;
816816
map->pblk = udf_get_lb_pblock(inode->i_sb, &eloc, offset);
817+
ret = 0;
817818
goto out_free;
818819
}
819820

0 commit comments

Comments
 (0)