All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ceph: Fix oops when mounting cephfs with non-existing path
@ 2012-08-17  5:55 Yan, Zheng
  2012-08-17 15:54 ` Sage Weil
  0 siblings, 1 reply; 4+ messages in thread
From: Yan, Zheng @ 2012-08-17  5:55 UTC (permalink / raw)
  To: ceph-devel; +Cc: Yan, Zheng

From: "Yan, Zheng" <zheng.z.yan@intel.com>

req->r_locked_dir is NULL if the request was created by
open_root_dentry(). ceph_fill_trace() lacks check for this case.
It causes oops when mounting cephfs with non-existing path.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
---
 fs/ceph/inode.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c
index 9fff9f3..40e2ef1 100644
--- a/fs/ceph/inode.c
+++ b/fs/ceph/inode.c
@@ -992,6 +992,13 @@ int ceph_fill_trace(struct super_block *sb, struct ceph_mds_request *req,
 	if (rinfo->head->is_dentry) {
 		struct inode *dir = req->r_locked_dir;
 
+		/*
+		 * req->r_locked_dir is null if the request was created
+		 * by open_root_dentry()
+		 */
+		if (!dir)
+			return le32_to_cpu(rinfo->head->result);
+
 		err = fill_inode(dir, &rinfo->diri, rinfo->dirfrag,
 				 session, req->r_request_started, -1,
 				 &req->r_caps_reservation);
-- 
1.7.11.2


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-08-20  2:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-17  5:55 [PATCH] ceph: Fix oops when mounting cephfs with non-existing path Yan, Zheng
2012-08-17 15:54 ` Sage Weil
2012-08-17 16:01   ` Tommi Virtanen
2012-08-20  2:47   ` Yan, Zheng

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.