summaryrefslogtreecommitdiffstats
path: root/fs/ceph/mds_client.c
diff options
context:
space:
mode:
authorYan, Zheng2013-09-18 03:44:13 +0200
committerSage Weil2013-09-30 23:49:53 +0200
commit81c6aea5275eae453719d7f3924da07e668265c5 (patch)
tree97fab33034d7b3f99cf4e875c1ed5c50bff54b78 /fs/ceph/mds_client.c
parentceph: remove outdated frag information (diff)
downloadkernel-qcow2-linux-81c6aea5275eae453719d7f3924da07e668265c5.tar.gz
kernel-qcow2-linux-81c6aea5275eae453719d7f3924da07e668265c5.tar.xz
kernel-qcow2-linux-81c6aea5275eae453719d7f3924da07e668265c5.zip
ceph: handle frag mismatch between readdir request and reply
If client has outdated directory fragments information, it may request readdir an non-existent directory fragment. In this case, the MDS finds an approximate directory fragment and sends its contents back to the client. When receiving a reply with fragment that is different than the requested one, the client need to reset the 'readdir offset'. Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com> Reviewed-by: Sage Weil <sage@inktank.com>
Diffstat (limited to 'fs/ceph/mds_client.c')
-rw-r--r--fs/ceph/mds_client.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c
index b7bda5d9611d..f51ab2627b41 100644
--- a/fs/ceph/mds_client.c
+++ b/fs/ceph/mds_client.c
@@ -2238,8 +2238,7 @@ static void handle_reply(struct ceph_mds_session *session, struct ceph_msg *msg)
err = ceph_fill_trace(mdsc->fsc->sb, req, req->r_session);
if (err == 0) {
if (result == 0 && (req->r_op == CEPH_MDS_OP_READDIR ||
- req->r_op == CEPH_MDS_OP_LSSNAP) &&
- rinfo->dir_nr)
+ req->r_op == CEPH_MDS_OP_LSSNAP))
ceph_readdir_prepopulate(req, req->r_session);
ceph_unreserve_caps(mdsc, &req->r_caps_reservation);
}