ceph: fix bad pointer dereference in ceph_fill_trace
authorSage Weil <sage@newdream.net>
Sat, 6 Nov 2010 19:41:16 +0000 (12:41 -0700)
committerSage Weil <sage@newdream.net>
Sun, 7 Nov 2010 16:40:43 +0000 (08:40 -0800)
We dereference *in a few lines down, but only set it on rename.  It is
apparently pretty rare for this to trigger, but I have been hitting it
with a clustered MDSs.

Signed-off-by: Sage Weil <sage@newdream.net>
fs/ceph/inode.c

index 1d6a45b..cd0432c 100644 (file)
@@ -1055,7 +1055,8 @@ int ceph_fill_trace(struct super_block *sb, struct ceph_mds_request *req,
                ininfo = rinfo->targeti.in;
                vino.ino = le64_to_cpu(ininfo->ino);
                vino.snap = le64_to_cpu(ininfo->snapid);
-               if (!dn->d_inode) {
+               in = dn->d_inode;
+               if (!in) {
                        in = ceph_get_inode(sb, vino);
                        if (IS_ERR(in)) {
                                pr_err("fill_trace bad get_inode "