mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2025-01-24 06:44:23 +08:00
[XFS] Initialise current offset in xfs_file_readdir correctly
After reading the directory contents into the temporary buffer, we grab each dirent and pass it to filldir witht eh current offset of the dirent. The current offset was not being set for the first dirent in the temporary buffer, which coul dresult in bad offsets being set in the f_pos field result in looping and duplicate entries being returned from readdir. SGI-PV: 974905 SGI-Modid: xfs-linux-melb:xfs-kern:30282a Signed-off-by: David Chinner <dgc@sgi.com> Signed-off-by: Tim Shimmin <tes@sgi.com> Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
This commit is contained in:
parent
bad60fdd14
commit
4743e0ec12
@ -347,6 +347,7 @@ xfs_file_readdir(
|
|||||||
|
|
||||||
size = buf.used;
|
size = buf.used;
|
||||||
de = (struct hack_dirent *)buf.dirent;
|
de = (struct hack_dirent *)buf.dirent;
|
||||||
|
curr_offset = de->offset /* & 0x7fffffff */;
|
||||||
while (size > 0) {
|
while (size > 0) {
|
||||||
if (filldir(dirent, de->name, de->namlen,
|
if (filldir(dirent, de->name, de->namlen,
|
||||||
curr_offset & 0x7fffffff,
|
curr_offset & 0x7fffffff,
|
||||||
|
Loading…
Reference in New Issue
Block a user