Skip to content

Commit

Permalink
jfs: fix readdir regression
Browse files Browse the repository at this point in the history
Upstream commit 44512449, "jfs: fix readdir cookie incompatibility
with NFSv4", was backported incorrectly into the stable trees which
used the filldir callback (rather than dir_emit). The position is
being incorrectly passed to filldir for the . and .. entries.

The still-maintained stable trees that need to be fixed are 3.2.y,
3.4.y and 3.10.y.

https://bugzilla.kernel.org/show_bug.cgi?id=94741

Signed-off-by: Dave Kleikamp <[email protected]>
Cc: [email protected]
Signed-off-by: Zefan Li <[email protected]>
  • Loading branch information
kleikamp authored and arnaullv committed Nov 1, 2017
1 parent 556143b commit 2ab2534
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fs/jfs/jfs_dtree.c
Original file line number Diff line number Diff line change
Expand Up @@ -3103,15 +3103,15 @@ int jfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
* self "."
*/
filp->f_pos = 1;
if (filldir(dirent, ".", 1, 0, ip->i_ino,
if (filldir(dirent, ".", 1, 1, ip->i_ino,
DT_DIR))
return 0;
}
/*
* parent ".."
*/
filp->f_pos = 2;
if (filldir(dirent, "..", 2, 1, PARENT(ip), DT_DIR))
if (filldir(dirent, "..", 2, 2, PARENT(ip), DT_DIR))
return 0;

/*
Expand Down

0 comments on commit 2ab2534

Please sign in to comment.