Hongnan Li e66205ee2d erofs: update ctx->pos for every emitted dirent
[ Upstream commit ecce9212d0fd7a2d4a4998f0c4623a66887e14c8 ]

erofs_readdir update ctx->pos after filling a batch of dentries
and it may cause dir/files duplication for NFS readdirplus which
depends on ctx->pos to fill dir correctly. So update ctx->pos for
every emitted dirent in erofs_fill_dentries to fix it.

Also fix the update of ctx->pos when the initial file position has
exceeded nameoff.

Fixes: 3e917cc305c6 ("erofs: make filesystem exportable")
Signed-off-by: Hongnan Li <hongnan.li@linux.alibaba.com>
Signed-off-by: Jeffle Xu <jefflexu@linux.alibaba.com>
Reviewed-by: Gao Xiang <hsiangkao@linux.alibaba.com>
Reviewed-by: Chao Yu <chao@kernel.org>
Link: https://lore.kernel.org/r/20220722082732.30935-1-jefflexu@linux.alibaba.com
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-08-17 15:14:21 +02:00
..
2022-05-24 19:55:07 -07:00
2022-06-01 11:54:29 -07:00
2022-05-18 00:11:19 +08:00
2022-05-18 00:11:19 +08:00
2022-05-17 23:48:54 +08:00
2021-10-25 08:22:59 +08:00
2022-05-24 19:55:07 -07:00
2022-05-18 00:11:21 +08:00
2022-06-01 11:54:29 -07:00
2022-03-17 00:08:48 +08:00