mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-12 13:55:32 +00:00
ceph: fix readdir vs fragmentation race
following sequence of events tigger the race - client readdir frag 0* -> got item 'A' - MDS merges frag 0* and frag 1* - client send readdir request (frag 1*, offset 2, readdir_start 'A') - MDS reply items (that are after item 'A') in frag * Link: http://tracker.ceph.com/issues/17286 Signed-off-by: Yan, Zheng <zyan@redhat.com>
This commit is contained in:
parent
0d7718f666
commit
f72f94555a
1 changed files with 2 additions and 1 deletions
|
@ -1511,7 +1511,8 @@ int ceph_readdir_prepopulate(struct ceph_mds_request *req,
|
||||||
ceph_fill_dirfrag(d_inode(parent), rinfo->dir_dir);
|
ceph_fill_dirfrag(d_inode(parent), rinfo->dir_dir);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ceph_frag_is_leftmost(frag) && req->r_readdir_offset == 2) {
|
if (ceph_frag_is_leftmost(frag) && req->r_readdir_offset == 2 &&
|
||||||
|
!(rinfo->hash_order && req->r_path2)) {
|
||||||
/* note dir version at start of readdir so we can tell
|
/* note dir version at start of readdir so we can tell
|
||||||
* if any dentries get dropped */
|
* if any dentries get dropped */
|
||||||
req->r_dir_release_cnt = atomic64_read(&ci->i_release_count);
|
req->r_dir_release_cnt = atomic64_read(&ci->i_release_count);
|
||||||
|
|
Loading…
Reference in a new issue