ceph: ceph_mdsc_build_path() returns an ERR_PTR
Subsystems (2)
PATCH 1/1 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 <[email protected]>
fs/ceph/debugfs.c +4 -0
@@ -171,6 +171,8 @@ static int mdsc_show(struct seq_file *s, void *p) }else if (req->r_dentry) { path =ceph_mdsc_build_path (req->r_dentry, &pathlen, &pathbase,0 ); +if (IS_ERR (path)) + path =NULL ;spin_lock (&req->r_dentry->d_lock); seq_printf(s, " #%llx/%.*s (%s)", ceph_ino(req->r_dentry->d_parent->d_inode),
@@ -187,6 +189,8 @@ static int mdsc_show(struct seq_file *s, void *p)if (req->r_old_dentry) { path =ceph_mdsc_build_path (req->r_old_dentry, &pathlen, &pathbase,0 ); +if (IS_ERR (path)) + path =NULL ;spin_lock (&req->r_old_dentry->d_lock); seq_printf(s, " #%llx/%.*s (%s)", ceph_ino(req->r_old_dentry->d_parent->d_inode),
Sage Weil
AppliedApplied, thanks!
sage
Quoted 33 lines · Dan Carpenter
ceph_mdsc_build_path()returns anERR_PTRbut this code is set up to handle NULL returns.Signed-off-by Dan Carpenter <[email protected]>fs/ceph/debugfs.c +4
-1@@ -171,6 +171,8 @@ static int mdsc_show(struct seq_file *s, void *p) }else if (req->r_dentry) { path =ceph_mdsc_build_path (req->r_dentry, &pathlen, &pathbase,0 ); +if (IS_ERR (path)) + path =NULL ;spin_lock (&req->r_dentry->d_lock); seq_printf(s, " #%llx/%.*s (%s)", ceph_ino(req->r_dentry->d_parent->d_inode),@@ -187,6 +189,8 @@ static int mdsc_show(struct seq_file *s, void *p)if (req->r_old_dentry) { path =ceph_mdsc_build_path (req->r_old_dentry, &pathlen, &pathbase,0 ); +if (IS_ERR (path)) + path =NULL ;spin_lock (&req->r_old_dentry->d_lock); seq_printf(s, " #%llx/%.*s (%s)", ceph_ino(req->r_old_dentry->d_parent->d_inode), --To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html