ubifs: Fix regression in ubifs_readdir()
[pandora-kernel.git] / fs / ubifs / dir.c
index ca4eb94..348dcb2 100644 (file)
@@ -477,6 +477,14 @@ static int ubifs_readdir(struct file *file, void *dirent, filldir_t filldir)
 out:
        if (err != -ENOENT)
                ubifs_err("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;
+
 
        kfree(file->private_data);
        file->private_data = NULL;