Skip to content

Commit f44c389

Browse files
error27liewegas
authored andcommitted
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: Dan Carpenter <error27@gmail.com> Signed-off-by: Sage Weil <sage@newdream.net>
1 parent ad8453a commit f44c389

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

‎fs/ceph/debugfs.c‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,8 @@ static int mdsc_show(struct seq_file *s, void *p)
171171
} else if (req->r_dentry) {
172172
path = ceph_mdsc_build_path(req->r_dentry, &pathlen,
173173
&pathbase, 0);
174+
if (IS_ERR(path))
175+
path = NULL;
174176
spin_lock(&req->r_dentry->d_lock);
175177
seq_printf(s, " #%llx/%.*s (%s)",
176178
ceph_ino(req->r_dentry->d_parent->d_inode),
@@ -187,6 +189,8 @@ static int mdsc_show(struct seq_file *s, void *p)
187189
if (req->r_old_dentry) {
188190
path = ceph_mdsc_build_path(req->r_old_dentry, &pathlen,
189191
&pathbase, 0);
192+
if (IS_ERR(path))
193+
path = NULL;
190194
spin_lock(&req->r_old_dentry->d_lock);
191195
seq_printf(s, " #%llx/%.*s (%s)",
192196
ceph_ino(req->r_old_dentry->d_parent->d_inode),

0 commit comments

Comments
 (0)