Skip to content

Commit 672820a

Browse files
ordexbrauner
authored andcommitted
ovl: properly print correct variable
In case of ovl_lookup_temp() failure, we currently print `err` which is actually not initialized at all. Instead, properly print PTR_ERR(whiteout) which is where the actual error really is. Address-Coverity-ID: 1647983 ("Uninitialized variables (UNINIT)") Fixes: 8afa0a7 ("ovl: narrow locking in ovl_whiteout()") Signed-off-by: Antonio Quartulli <[email protected]> Link: https://lore.kernel.org/[email protected] Reviewed-by: NeilBrown <[email protected]> Signed-off-by: Christian Brauner <[email protected]>
1 parent dc39778 commit 672820a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

fs/overlayfs/dir.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,9 @@ static struct dentry *ovl_whiteout(struct ovl_fs *ofs)
117117
if (!IS_ERR(whiteout))
118118
return whiteout;
119119
if (PTR_ERR(whiteout) != -EMLINK) {
120-
pr_warn("Failed to link whiteout - disabling whiteout inode sharing(nlink=%u, err=%i)\n",
121-
ofs->whiteout->d_inode->i_nlink, err);
120+
pr_warn("Failed to link whiteout - disabling whiteout inode sharing(nlink=%u, err=%lu)\n",
121+
ofs->whiteout->d_inode->i_nlink,
122+
PTR_ERR(whiteout));
122123
ofs->no_shared_whiteout = true;
123124
}
124125
}

0 commit comments

Comments
 (0)