diff options
author | Yan, Zheng <zyan@redhat.com> | 2017-07-06 11:12:21 +0800 |
---|---|---|
committer | Ilya Dryomov <idryomov@gmail.com> | 2017-07-17 14:54:59 +0200 |
commit | 84583cfb973c4313955c6231cc9cb3772d280b15 (patch) | |
tree | 5ac4ce6d853b9ee2798cf87b72f32796618a8b19 /net/ceph | |
parent | 914902af4f271884968f72c4fa144c723be2a699 (diff) |
ceph: fix race in concurrent readdir
For a large directory, program needs to issue multiple readdir
syscalls to get all dentries. When there are multiple programs
read the directory concurrently. Following sequence of events
can happen.
- program calls readdir with pos = 2. ceph sends readdir request
to mds. The reply contains N1 entries. ceph adds these N1 entries
to readdir cache.
- program calls readdir with pos = N1+2. The readdir is satisfied
by the readdir cache, N2 entries are returned. (Other program
calls readdir in the middle, which fills the cache)
- program calls readdir with pos = N1+N2+2. ceph sends readdir
request to mds. The reply contains N3 entries and it reaches
directory end. ceph adds these N3 entries to the readdir cache
and marks directory complete.
The second readdir call does not update fi->readdir_cache_idx.
ceph add the last N3 entries to wrong places.
Cc: stable@vger.kernel.org # v4.3+
Signed-off-by: "Yan, Zheng" <zyan@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Diffstat (limited to 'net/ceph')
0 files changed, 0 insertions, 0 deletions