cifs: Missing files in mount
Patrick Horng [Sat, 25 Feb 2017 01:11:03 +0000 (17:11 -0800)]
Missing files was caused by EINVAL from filldir64
during cifs_filldir when revalidating the inode.

Bug 1834380

Change-Id: Ia0c8e7a72f4b9b810c9f1c15d3190d42fcf5fd8c
Signed-off-by: Patrick Horng <phorng@nvidia.com>
Reviewed-on: http://git-master/r/1311307
Reviewed-by: Manish Tuteja <mtuteja@nvidia.com>
Tested-by: Manish Tuteja <mtuteja@nvidia.com>

fs/cifs/readdir.c

index 85ebdaa..48b0b8e 100644 (file)
@@ -857,8 +857,10 @@ int cifs_readdir(struct file *file, void *direntry, filldir_t filldir)
                         */
                        rc = cifs_filldir(current_entry, file, filldir,
                                          direntry, tmp_buf, max_len);
-                       if (rc == -EOVERFLOW) {
-                               rc = 0;
+                       if (rc) {
+                               pr_err("cifs_filldir failed with rc = %d\n", rc);
+                               if (rc > 0)
+                                       rc = 0;
                                break;
                        }