All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Weinberger <richard@nod.at>
To: linux-mtd@lists.infradead.org
Cc: adrian.hunter@intel.com, dedekind1@gmail.com,
	linux-kernel@vger.kernel.org, peda@axentia.se,
	ralph.sennhauser@gmail.com, Richard Weinberger <richard@nod.at>,
	stable@vger.kernel.org
Subject: [PATCH] ubifs: Fix regression in ubifs_readdir()
Date: Fri, 28 Oct 2016 11:53:52 +0200	[thread overview]
Message-ID: <1477648432-9543-1-git-send-email-richard@nod.at> (raw)

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

             reply	other threads:[~2016-10-28  9:57 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-28  9:53 Richard Weinberger [this message]
2016-10-28 16:19 ` [PATCH] ubifs: Fix regression in ubifs_readdir() 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1477648432-9543-1-git-send-email-richard@nod.at \
    --to=richard@nod.at \
    --cc=adrian.hunter@intel.com \
    --cc=dedekind1@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=peda@axentia.se \
    --cc=ralph.sennhauser@gmail.com \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.