]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
kclient: fix cap reconnect path generation
authorSage Weil <sage@newdream.net>
Thu, 11 Jun 2009 21:03:22 +0000 (14:03 -0700)
committerSage Weil <sage@newdream.net>
Thu, 11 Jun 2009 21:03:22 +0000 (14:03 -0700)
This was preventing all caps from reconnecting on mds restart.

src/kernel/mds_client.c

index 23651221e1c9674e288dda63e0d2406ee9b3b095..68a82aa24e58a96a4734b736b607f3abcec49e27 100644 (file)
@@ -1008,7 +1008,8 @@ retry:
                struct inode *inode = temp->d_inode;
                if (inode && ceph_snap(inode) == CEPH_SNAPDIR)
                        len++;  /* slash only */
-               else if (inode && ceph_snap(inode) == CEPH_NOSNAP)
+               else if (stop_on_nosnap && inode &&
+                        ceph_snap(inode) == CEPH_NOSNAP)
                        break;
                else
                        len += 1 + temp->d_name.len;
@@ -1032,7 +1033,8 @@ retry:
                if (inode && ceph_snap(inode) == CEPH_SNAPDIR) {
                        dout(50, "build_path_dentry path+%d: %p SNAPDIR\n",
                             pos, temp);
-               } else if (inode && ceph_snap(inode) == CEPH_NOSNAP) {
+               } else if (stop_on_nosnap && inode &&
+                          ceph_snap(inode) == CEPH_NOSNAP) {
                        break;
                } else {
                        pos -= temp->d_name.len;
@@ -1863,7 +1865,7 @@ static int encode_caps_cb(struct inode *inode, struct ceph_cap *cap,
 
        dentry = d_find_alias(inode);
        if (dentry) {
-               path = ceph_mdsc_build_path(dentry, &pathlen, &pathbase, -1);
+               path = ceph_mdsc_build_path(dentry, &pathlen, &pathbase, 0);
                if (IS_ERR(path)) {
                        err = PTR_ERR(path);
                        BUG_ON(err);