summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorRichard Weinberger <richard@nod.at>2016-10-19 12:43:07 +0200
committerBen Hutchings <ben@decadent.org.uk>2017-02-23 03:54:18 +0000
commit8a8d8a7c8b819b72d73f4ba3ffa854d194b928b0 (patch)
tree4f190a5db93a84c7a06358892c1729a7caf61f47 /include
parent7652f9e9895c7074f96a1ca546b9575f3cb86069 (diff)
ubifs: Abort readdir upon error
commit c83ed4c9dbb358b9e7707486e167e940d48bfeed upstream. If UBIFS is facing an error while walking a directory, it reports this error and ubifs_readdir() returns the error code. But the VFS readdir logic does not make the getdents system call fail in all cases. When the readdir cursor indicates that more entries are present, the system call will just return and the libc wrapper will try again since it also knows that more entries are present. This causes the libc wrapper to busy loop for ever when a directory is corrupted on UBIFS. A common approach do deal with corrupted directory entries is skipping them by setting the cursor to the next entry. On UBIFS this approach is not possible since we cannot compute the next directory entry cursor position without reading the current entry. So all we can do is setting the cursor to the "no more entries" position and make getdents exit. Signed-off-by: Richard Weinberger <richard@nod.at> [bwh: Backported to 3.16: adjust context] Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Diffstat (limited to 'include')
0 files changed, 0 insertions, 0 deletions