Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a00052a2 authored by Richard Weinberger's avatar Richard Weinberger
Browse files

ubifs: Fix regression in ubifs_readdir()



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")
Cc: stable@vger.kernel.org
Signed-off-by: default avatarRichard Weinberger <richard@nod.at>
parent 40b6e61a
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -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;