]> git.baikalelectronics.ru Git - kernel.git/commit
ceph: choose readdir frag based on previous readdir reply
authorYan, Zheng <zyan@redhat.com>
Mon, 24 Apr 2017 03:56:50 +0000 (11:56 +0800)
committerIlya Dryomov <idryomov@gmail.com>
Thu, 4 May 2017 07:19:24 +0000 (09:19 +0200)
commit367f1dfc342bb01373c48b93ec1734f2b79b336b
tree709577ea2cd61fc1e8402ca7e2db67043a843ff4
parent4b36f4e353473ba45159d5637c7e576e0baab699
ceph: choose readdir frag based on previous readdir reply

The dirfragtree is lazily updated, it's not always accurate. Infinite
loops happens in following circumstance.

- client send request to read frag A
- frag A has been fragmented into frag B and C. So mds fills the reply
  with contents of frag B
- client wants to read next frag C. ceph_choose_frag(frag value of C)
  return frag A.

The fix is using previous readdir reply to calculate next readdir frag
when possible.

Signed-off-by: "Yan, Zheng" <zyan@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
fs/ceph/dir.c