ubifs: Fix regression in ubifs_readdir()
Commitc83ed4c9db
("ubifs: Abort readdir upon error") broke overlayfs support because the fix exposed an internal error code to VFS. Reported-by: Peter Rosin <peda@axentia.se> Tested-by: Peter Rosin <peda@axentia.se> Reported-by: Ralph Sennhauser <ralph.sennhauser@gmail.com> Tested-by: Ralph Sennhauser <ralph.sennhauser@gmail.com> Fixes:c83ed4c9db
("ubifs: Abort readdir upon error") Cc: stable@vger.kernel.org Signed-off-by: Richard Weinberger <richard@nod.at>
This commit is contained in:
parent
40b6e61ac7
commit
a00052a296
|
@ -543,6 +543,14 @@ static int ubifs_readdir(struct file *file, struct dir_context *ctx)
|
|||
|
||||
if (err != -ENOENT)
|
||||
ubifs_err(c, "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 */
|
||||
ctx->pos = 2;
|
||||
|
|
Loading…
Reference in New Issue