Commit f44c3890 authored by Dan Carpenter's avatar Dan Carpenter Committed by Sage Weil

ceph: ceph_mdsc_build_path() returns an ERR_PTR

ceph_mdsc_build_path() returns an ERR_PTR but this code is set up to
handle NULL returns.
Signed-off-by: default avatarDan Carpenter <error27@gmail.com>
Signed-off-by: default avatarSage Weil <sage@newdream.net>
parent ad8453ab
...@@ -171,6 +171,8 @@ static int mdsc_show(struct seq_file *s, void *p) ...@@ -171,6 +171,8 @@ static int mdsc_show(struct seq_file *s, void *p)
} else if (req->r_dentry) { } else if (req->r_dentry) {
path = ceph_mdsc_build_path(req->r_dentry, &pathlen, path = ceph_mdsc_build_path(req->r_dentry, &pathlen,
&pathbase, 0); &pathbase, 0);
if (IS_ERR(path))
path = NULL;
spin_lock(&req->r_dentry->d_lock); spin_lock(&req->r_dentry->d_lock);
seq_printf(s, " #%llx/%.*s (%s)", seq_printf(s, " #%llx/%.*s (%s)",
ceph_ino(req->r_dentry->d_parent->d_inode), ceph_ino(req->r_dentry->d_parent->d_inode),
...@@ -187,6 +189,8 @@ static int mdsc_show(struct seq_file *s, void *p) ...@@ -187,6 +189,8 @@ static int mdsc_show(struct seq_file *s, void *p)
if (req->r_old_dentry) { if (req->r_old_dentry) {
path = ceph_mdsc_build_path(req->r_old_dentry, &pathlen, path = ceph_mdsc_build_path(req->r_old_dentry, &pathlen,
&pathbase, 0); &pathbase, 0);
if (IS_ERR(path))
path = NULL;
spin_lock(&req->r_old_dentry->d_lock); spin_lock(&req->r_old_dentry->d_lock);
seq_printf(s, " #%llx/%.*s (%s)", seq_printf(s, " #%llx/%.*s (%s)",
ceph_ino(req->r_old_dentry->d_parent->d_inode), ceph_ino(req->r_old_dentry->d_parent->d_inode),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment