Skip to content

Commit 8d45b91

Browse files
ukernelidryomov
authored andcommitted
ceph: don't fill readdir cache for LSSNAP reply
Signed-off-by: "Yan, Zheng" <[email protected]> Signed-off-by: Ilya Dryomov <[email protected]>
1 parent 9a86962 commit 8d45b91

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

fs/ceph/inode.c

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1516,15 +1516,18 @@ int ceph_readdir_prepopulate(struct ceph_mds_request *req,
15161516
rinfo->dir_nr, parent);
15171517
if (rinfo->dir_dir)
15181518
ceph_fill_dirfrag(d_inode(parent), rinfo->dir_dir);
1519-
}
15201519

1521-
if (ceph_frag_is_leftmost(frag) && req->r_readdir_offset == 2 &&
1522-
!(rinfo->hash_order && last_hash)) {
1523-
/* note dir version at start of readdir so we can tell
1524-
* if any dentries get dropped */
1525-
req->r_dir_release_cnt = atomic64_read(&ci->i_release_count);
1526-
req->r_dir_ordered_cnt = atomic64_read(&ci->i_ordered_count);
1527-
req->r_readdir_cache_idx = 0;
1520+
if (ceph_frag_is_leftmost(frag) &&
1521+
req->r_readdir_offset == 2 &&
1522+
!(rinfo->hash_order && last_hash)) {
1523+
/* note dir version at start of readdir so we can
1524+
* tell if any dentries get dropped */
1525+
req->r_dir_release_cnt =
1526+
atomic64_read(&ci->i_release_count);
1527+
req->r_dir_ordered_cnt =
1528+
atomic64_read(&ci->i_ordered_count);
1529+
req->r_readdir_cache_idx = 0;
1530+
}
15281531
}
15291532

15301533
cache_ctl.index = req->r_readdir_cache_idx;

0 commit comments

Comments
 (0)