diff options
author | Richard Weinberger <richard@nod.at> | 2016-10-19 12:43:07 +0200 |
---|---|---|
committer | Richard Weinberger <richard@nod.at> | 2016-10-20 00:06:11 +0200 |
commit | c83ed4c9dbb358b9e7707486e167e940d48bfeed (patch) | |
tree | 89f1cd092e2b89f71407cdf784d3e5b7c95d1f68 /drivers/net/sunvnet.h | |
parent | UBI: Fix crash in try_recover_peb() (diff) | |
download | linux-c83ed4c9dbb358b9e7707486e167e940d48bfeed.tar.xz linux-c83ed4c9dbb358b9e7707486e167e940d48bfeed.zip |
ubifs: Abort readdir upon error
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.
Cc: stable@vger.kernel.org
Signed-off-by: Richard Weinberger <richard@nod.at>
Diffstat (limited to 'drivers/net/sunvnet.h')
0 files changed, 0 insertions, 0 deletions