Commit 55586859 authored by Richard Weinberger's avatar Richard Weinberger Committed by Willy Tarreau

ubifs: Fix regression in ubifs_readdir()

commit a00052a2 upstream.

Commit c83ed4c9 ("ubifs: Abort readdir upon error") broke
overlayfs support because the fix exposed an internal error
code to VFS.
Reported-by: default avatarPeter Rosin <peda@axentia.se>
Tested-by: default avatarPeter Rosin <peda@axentia.se>
Reported-by: default avatarRalph Sennhauser <ralph.sennhauser@gmail.com>
Tested-by: default avatarRalph Sennhauser <ralph.sennhauser@gmail.com>
Fixes: c83ed4c9 ("ubifs: Abort readdir upon error")
Signed-off-by: default avatarRichard Weinberger <richard@nod.at>
Signed-off-by: default avatarWilly Tarreau <w@1wt.eu>
parent 1bf1f0c7
......@@ -473,6 +473,14 @@ static int ubifs_readdir(struct file *file, void *dirent, filldir_t filldir)
if (err != -ENOENT)
ubifs_err("cannot find next direntry, error %d", err);
else
/*
* -ENOENT is a non-fatal error in this context, the TNC uses
* it to indicate that the cursor moved past the current directory
* and readdir() has to stop.
*/
err = 0;
/* 2 is a special value indicating that there are no more direntries */
file->f_pos = 2;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment