summaryrefslogtreecommitdiff
path: root/fs/ubifs/super.c
diff options
context:
space:
mode:
authorRichard Weinberger <richard@nod.at>2019-05-14 23:31:08 +0300
committerRichard Weinberger <richard@nod.at>2019-07-08 20:13:41 +0300
commitbacfa94b08027b9f66ede7044972e3b066766b3e (patch)
treec137b940ba432e0a4c9b70012b0343b86371825b /fs/ubifs/super.c
parent6fbc7275c7a9ba97877050335f290341a1fd8dbf (diff)
downloadlinux-bacfa94b08027b9f66ede7044972e3b066766b3e.tar.xz
ubifs: Correctly use tnc_next() in search_dh_cookie()
Commit c877154d307f fixed an uninitialized variable and optimized the function to not call tnc_next() in the first iteration of the loop. While this seemed perfectly legit and wise, it turned out to be illegal. If the lookup function does not find an exact match it will rewind the cursor by 1. The rewinded cursor will not match the name hash we are looking for and this results in a spurious -ENOENT. So we need to move to the next entry in case of an non-exact match, but not if the match was exact. While we are here, update the documentation to avoid further confusion. Cc: Hyunchul Lee <hyc.lee@gmail.com> Cc: Geert Uytterhoeven <geert@linux-m68k.org> Fixes: c877154d307f ("ubifs: Fix uninitialized variable in search_dh_cookie()") Fixes: 781f675e2d7e ("ubifs: Fix unlink code wrt. double hash lookups") Signed-off-by: Richard Weinberger <richard@nod.at>
Diffstat (limited to 'fs/ubifs/super.c')
0 files changed, 0 insertions, 0 deletions