All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ubifs: Fix regression in ubifs_readdir()
@ 2016-10-28  9:53 Richard Weinberger
  2016-10-28 16:19   ` Jörg Krause
  0 siblings, 1 reply; 17+ messages in thread
From: Richard Weinberger @ 2016-10-28  9:53 UTC (permalink / raw)
  To: linux-mtd
  Cc: adrian.hunter, dedekind1, linux-kernel, peda, ralph.sennhauser,
	Richard Weinberger, stable

Commit c83ed4c9dbb35 ("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>
Fixes: c83ed4c9dbb35 ("ubifs: Abort readdir upon error")
Cc: stable@vger.kernel.org
Signed-off-by: Richard Weinberger <richard@nod.at>
---
 fs/ubifs/dir.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/fs/ubifs/dir.c b/fs/ubifs/dir.c
index bd4a5e8ce441..ca16c5d7bab1 100644
--- a/fs/ubifs/dir.c
+++ b/fs/ubifs/dir.c
@@ -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;
-- 
2.7.3

^ permalink raw reply related	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2016-11-07 22:54 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-28  9:53 [PATCH] ubifs: Fix regression in ubifs_readdir() Richard Weinberger
2016-10-28 16:19 ` Jörg Krause
2016-10-28 16:19   ` Jörg Krause
2016-10-28 17:07   ` Richard Weinberger
2016-10-28 22:23     ` Jörg Krause
2016-10-28 22:23       ` Jörg Krause
2016-10-29  9:04       ` Richard Weinberger
2016-11-01 22:22       ` [Buildroot] " Thomas Petazzoni
2016-11-02 19:56         ` Jörg Krause
2016-11-02 20:49           ` Thomas Petazzoni
2016-11-02 22:49             ` Jörg Krause
2016-11-03  2:46               ` Arnout Vandecappelle
2016-11-03  7:23                 ` Jörg Krause
2016-11-03 10:22                   ` Arnout Vandecappelle
2016-11-07 22:08                     ` Jörg Krause
2016-11-07 22:24                       ` Jörg Krause
2016-11-07 22:54                     ` Jörg Krause

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.