Skip to content

Commit e8ffaca

Browse files
Miklos Szeredigregkh
authored andcommitted
ovl: expand warning in ovl_d_real()
commit cef4cbf upstream. There was a syzbot report with this warning but insufficient information... Signed-off-by: Miklos Szeredi <mszeredi@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent b55528a commit e8ffaca

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

fs/overlayfs/super.c

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ static void ovl_dentry_release(struct dentry *dentry)
7979
static struct dentry *ovl_d_real(struct dentry *dentry,
8080
const struct inode *inode)
8181
{
82-
struct dentry *real;
82+
struct dentry *real = NULL, *lower;
8383

8484
/* It's an overlay file */
8585
if (inode && d_inode(dentry) == inode)
@@ -98,18 +98,21 @@ static struct dentry *ovl_d_real(struct dentry *dentry,
9898
if (real && !inode && ovl_has_upperdata(d_inode(dentry)))
9999
return real;
100100

101-
real = ovl_dentry_lowerdata(dentry);
102-
if (!real)
101+
lower = ovl_dentry_lowerdata(dentry);
102+
if (!lower)
103103
goto bug;
104+
real = lower;
104105

105106
/* Handle recursion */
106107
real = d_real(real, inode);
107108

108109
if (!inode || inode == d_inode(real))
109110
return real;
110111
bug:
111-
WARN(1, "ovl_d_real(%pd4, %s:%lu): real dentry not found\n", dentry,
112-
inode ? inode->i_sb->s_id : "NULL", inode ? inode->i_ino : 0);
112+
WARN(1, "%s(%pd4, %s:%lu): real dentry (%p/%lu) not found\n",
113+
__func__, dentry, inode ? inode->i_sb->s_id : "NULL",
114+
inode ? inode->i_ino : 0, real,
115+
real && d_inode(real) ? d_inode(real)->i_ino : 0);
113116
return dentry;
114117
}
115118

0 commit comments

Comments
 (0)