All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Yan, Zheng" <zheng.z.yan@intel.com>
To: ceph-devel@vger.kernel.org
Cc: "Yan, Zheng" <zheng.z.yan@intel.com>
Subject: [PATCH] ceph: Fix oops when mounting cephfs with non-existing path
Date: Fri, 17 Aug 2012 13:55:59 +0800	[thread overview]
Message-ID: <1345182959-6486-1-git-send-email-zheng.z.yan@intel.com> (raw)

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


             reply	other threads:[~2012-08-17  5:56 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-17  5:55 Yan, Zheng [this message]
2012-08-17 15:54 ` [PATCH] ceph: Fix oops when mounting cephfs with non-existing path Sage Weil
2012-08-17 16:01   ` Tommi Virtanen
2012-08-20  2:47   ` Yan, Zheng

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1345182959-6486-1-git-send-email-zheng.z.yan@intel.com \
    --to=zheng.z.yan@intel.com \
    --cc=ceph-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.