1
0
Fork 0
remarkable-linux/fs/ceph
Yan, Zheng acccf01a80 ceph: fix race in concurrent readdir
commit 84583cfb97 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:08:07 -07: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: Propagate dentry down to inode_change_ok() 2016-09-22 10:56:19 +02:00
addr.c fs: add i_blocksize() 2017-06-14 15:06:00 +02:00
cache.c ceph: fix spelling mistake: "resgister" -> "register" 2016-07-28 02:55:40 +02:00
cache.h ceph: improve fscache revalidation 2016-06-01 10:31:50 +02:00
caps.c ceph: try getting buffer capability for readahead/fadvise 2017-05-08 07:47:55 +02:00
ceph_frag.c ceph: factor out libceph from Ceph file system 2010-10-20 15:37:28 -07:00
debugfs.c ceph: don't show symlink target in debugfs/mdsc 2016-05-26 01:15:32 +02:00
dir.c ceph: fix race in concurrent readdir 2017-07-27 15:08:07 -07:00
export.c ceph: fix d_obtain_alias() misuses 2016-06-24 23:49:03 -04:00
file.c ceph: try getting buffer capability for readahead/fadvise 2017-05-08 07:47:55 +02:00
inode.c ceph: fix recursion between ceph_set_acl() and __ceph_setattr() 2017-05-03 08:36:39 -07:00
ioctl.c ceph: reduce i_nr_by_mode array size 2016-07-28 02:55:39 +02:00
ioctl.h ceph: fully initialize new layout 2012-05-16 14:28:27 -05:00
locks.c ceph: fix mandatory flock check 2016-10-03 16:13:49 +02:00
mds_client.c ceph: remove req from unsafe list when unregistering it 2017-03-15 10:02:45 +08:00
mds_client.h ceph: handle CEPH_SESSION_REJECT message 2016-10-03 16:13:50 +02:00
mdsmap.c ceph: CEPH_FEATURE_MDSENC support 2016-05-26 01:15:31 +02:00
snap.c ceph: cleanup ceph_flush_snaps() 2016-07-28 03:00:44 +02:00
strings.c ceph: handle CEPH_SESSION_REJECT message 2016-10-03 16:13:50 +02:00
super.c ceph: fix uninitialized dentry pointer in ceph_real_mount() 2016-10-18 12:10:59 +02:00
super.h ceph: try getting buffer capability for readahead/fadvise 2017-05-08 07:47:55 +02:00
xattr.c ceph: fix memory leak in __ceph_setxattr() 2017-05-20 14:28:39 +02:00