android_kernel_oneplus_msm8998/fs/ceph
Yan, Zheng ba790013b5 ceph: fix race in concurrent readdir
commit 84583cfb973c4313955c6231cc9cb3772d280b15 upstream.

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.

Signed-off-by: "Yan, Zheng" <zyan@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-07-27 15:06:09 -07:00
..
acl.c ceph: fix recursion between ceph_set_acl() and __ceph_setattr() 2017-05-25 14:30:13 +02:00
addr.c fs: add i_blocksize() 2017-06-14 13:16:24 +02:00
cache.c ceph: fix a comment typo 2015-11-02 23:36:47 +01:00
cache.h
caps.c ceph: make fsync() wait unsafe requests that created/modified inode 2015-11-02 23:36:48 +01:00
ceph_frag.c
debugfs.c
dir.c ceph: fix race in concurrent readdir 2017-07-27 15:06:09 -07:00
export.c
file.c ceph: fix error handling in ceph_read_iter 2016-10-28 03:01:35 -04:00
inode.c ceph: fix recursion between ceph_set_acl() and __ceph_setattr() 2017-05-25 14:30:13 +02:00
ioctl.c
ioctl.h
Kconfig
locks.c
Makefile
mds_client.c ceph: remove req from unsafe list when unregistering it 2017-03-15 09:57:13 +08:00
mds_client.h ceph: make fsync() wait unsafe requests that created/modified inode 2015-11-02 23:36:48 +01:00
mdsmap.c
snap.c
strings.c
super.c
super.h ceph: fix recursion between ceph_set_acl() and __ceph_setattr() 2017-05-25 14:30:13 +02:00
xattr.c ceph: fix memory leak in __ceph_setxattr() 2017-05-20 14:27:01 +02:00