Skip to content

Commit

Permalink
ubifs: Fix regression in ubifs_readdir()
Browse files Browse the repository at this point in the history
Commit c83ed4c ("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: c83ed4c ("ubifs: Abort readdir upon error")
Cc: stable@vger.kernel.org
Signed-off-by: Richard Weinberger <richard@nod.at>
  • Loading branch information
richardweinberger committed Oct 28, 2016
1 parent 40b6e61 commit a00052a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions fs/ubifs/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit a00052a

Please sign in to comment.