WSL2-Linux-Kernel/fs/ceph
Yan, Zheng 84583cfb97 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>
2017-07-17 14:54:59 +02:00
..
Kconfig ceph: add acl for cephfs 2013-12-31 20:32:01 +02:00
Makefile ceph: add acl for cephfs 2013-12-31 20:32:01 +02:00
acl.c ceph: unify inode i_ctime update 2017-06-14 19:37:23 +02:00
addr.c ceph: cleanup writepage_nounlock() 2017-07-07 17:25:13 +02:00
cache.c ceph: new mount option that specifies fscache uniquifier 2017-07-07 17:25:14 +02:00
cache.h ceph: improve fscache revalidation 2016-06-01 10:31:50 +02:00
caps.c ceph: avoid accessing freeing inode in ceph_check_delayed_caps() 2017-07-07 17:25:13 +02:00
ceph_frag.c ceph: factor out libceph from Ceph file system 2010-10-20 15:37:28 -07:00
debugfs.c The two main items are support for disabling automatic rbd exclusive 2017-05-10 08:42:33 -07:00
dir.c ceph: fix race in concurrent readdir 2017-07-17 14:54:59 +02:00
export.c ceph: check i_nlink while converting a file handle to dentry 2017-06-14 19:32:43 +02:00
file.c ceph: update the 'approaching max_size' code 2017-07-07 17:25:12 +02:00
inode.c ceph: update ceph_dentry_info::lease_session when necessary 2017-07-07 17:25:14 +02:00
ioctl.c ceph: fix bogus endianness change in ceph_ioctl_set_layout 2017-02-20 12:16:07 +01:00
ioctl.h ceph: fully initialize new layout 2012-05-16 14:28:27 -05:00
locks.c ceph: don't re-send interrupted flock request 2017-07-07 17:25:13 +02:00
mds_client.c ceph: avoid invalid memory dereference in the middle of umount 2017-07-07 17:25:13 +02:00
mds_client.h ceph: handle epoch barriers in cap messages 2017-05-04 09:19:21 +02:00
mdsmap.c ceph: allow connecting to mds whose rank >= mdsmap::m_max_mds 2017-05-04 09:19:20 +02:00
snap.c ceph: convert ceph_cap_snap.nref from atomic_t to refcount_t 2017-05-04 09:19:18 +02:00
strings.c ceph: handle CEPH_SESSION_REJECT message 2016-10-03 16:13:50 +02:00
super.c ceph: new mount option that specifies fscache uniquifier 2017-07-07 17:25:14 +02:00
super.h ceph: new mount option that specifies fscache uniquifier 2017-07-07 17:25:14 +02:00
xattr.c ceph: getattr before read on ceph.* xattrs 2017-07-07 17:25:13 +02:00