Browse Source

ceph: fix mksnap crash

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>
Yan, Zheng 10 năm trước cách đây
mục cha
commit
275dd19ea4
1 tập tin đã thay đổi với 3 bổ sung1 xóa
  1. 3 1
      fs/ceph/dir.c

+ 3 - 1
fs/ceph/dir.c

@@ -812,7 +812,9 @@ static int ceph_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode)
 		acls.pagelist = NULL;
 		acls.pagelist = NULL;
 	}
 	}
 	err = ceph_mdsc_do_request(mdsc, dir, req);
 	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);
 		err = ceph_handle_notrace_create(dir, dentry);
 	ceph_mdsc_put_request(req);
 	ceph_mdsc_put_request(req);
 out:
 out: