Skip to content

Commit a00052a

Browse files
ubifs: Fix regression in ubifs_readdir()
Commit c83ed4c ("ubifs: Abort readdir upon error") broke overlayfs support because the fix exposed an internal error code to VFS. Reported-by: Peter Rosin <[email protected]> Tested-by: Peter Rosin <[email protected]> Reported-by: Ralph Sennhauser <[email protected]> Tested-by: Ralph Sennhauser <[email protected]> Fixes: c83ed4c ("ubifs: Abort readdir upon error") Cc: [email protected] Signed-off-by: Richard Weinberger <[email protected]>
1 parent 40b6e61 commit a00052a

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

fs/ubifs/dir.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -543,6 +543,14 @@ static int ubifs_readdir(struct file *file, struct dir_context *ctx)
543543

544544
if (err != -ENOENT)
545545
ubifs_err(c, "cannot find next direntry, error %d", err);
546+
else
547+
/*
548+
* -ENOENT is a non-fatal error in this context, the TNC uses
549+
* it to indicate that the cursor moved past the current directory
550+
* and readdir() has to stop.
551+
*/
552+
err = 0;
553+
546554

547555
/* 2 is a special value indicating that there are no more direntries */
548556
ctx->pos = 2;

0 commit comments

Comments
 (0)