]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
kclient: fix fmode ref count buf
authorSage Weil <sage@newdream.net>
Tue, 3 Mar 2009 22:26:28 +0000 (14:26 -0800)
committerSage Weil <sage@newdream.net>
Tue, 3 Mar 2009 22:26:28 +0000 (14:26 -0800)
We weren't taking an fmode reference on the root dir.  This would
cause a WARN if our root caps were allowed to expire and we had
to ropen them.  Duplicated wonky r_fmode conditional from later
fill_inode() call in fill_trace().

src/kernel/inode.c

index 3c225559b67ed18574001a2a1cbb2f58c9a840a4..a8ad3ce59355ccf884347403ff92e6b1ab567d51 100644 (file)
@@ -862,7 +862,10 @@ int ceph_fill_trace(struct super_block *sb, struct ceph_mds_request *req,
                err = fill_inode(in, &rinfo->trace_in[0],
                                 rinfo->trace_numd ?
                                 rinfo->trace_dir[0] : NULL,
-                                session, req->r_request_started, -1);
+                                session, req->r_request_started,
+                                (rinfo->trace_numd == 0 &&
+                                 le32_to_cpu(rinfo->head->result) == 0) ?
+                                req->r_fmode : -1);
                if (err < 0)
                        return err;
                if (unlikely(sb->s_root == NULL))