ceph: fix mksnap crash
authorYan, Zheng <zyan@redhat.com>
Wed, 10 Dec 2014 08:17:31 +0000 (16:17 +0800)
committerIlya Dryomov <idryomov@redhat.com>
Wed, 17 Dec 2014 17:09:53 +0000 (20:09 +0300)
mksnap reply only contain 'target', does not contain 'dentry'. So
it's wrong to use req->r_reply_info.head->is_dentry to detect traceless
reply.

Signed-off-by: Yan, Zheng <zyan@redhat.com>
Reviewed-by: Sage Weil <sage@redhat.com>
fs/ceph/dir.c

index 652619950fa92834ecb79580c46bcff7d2aa1a76..fcfd0abc8c38a5c2d121b719faf929a9be656a33 100644 (file)
@@ -812,7 +812,9 @@ static int ceph_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode)
                acls.pagelist = NULL;
        }
        err = ceph_mdsc_do_request(mdsc, dir, req);
-       if (!err && !req->r_reply_info.head->is_dentry)
+       if (!err &&
+           !req->r_reply_info.head->is_target &&
+           !req->r_reply_info.head->is_dentry)
                err = ceph_handle_notrace_create(dir, dentry);
        ceph_mdsc_put_request(req);
 out: