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: 8afa0a7367 ("ovl: narrow locking in ovl_whiteout()")
Signed-off-by: Antonio Quartulli <antonio@mandelbit.com>
Link: https://lore.kernel.org/20250721203821.7812-1-antonio@mandelbit.com
Reviewed-by: NeilBrown <neil@brown.name>
Signed-off-by: Christian Brauner <brauner@kernel.org>
This commit is contained in:
Antonio Quartulli 2025-07-21 22:38:21 +02:00 committed by Christian Brauner
parent dc39778564
commit 672820a070
No known key found for this signature in database
GPG Key ID: 91C61BC06578DCA2

View File

@ -117,8 +117,9 @@ static struct dentry *ovl_whiteout(struct ovl_fs *ofs)
if (!IS_ERR(whiteout))
return whiteout;
if (PTR_ERR(whiteout) != -EMLINK) {
pr_warn("Failed to link whiteout - disabling whiteout inode sharing(nlink=%u, err=%i)\n",
ofs->whiteout->d_inode->i_nlink, err);
pr_warn("Failed to link whiteout - disabling whiteout inode sharing(nlink=%u, err=%lu)\n",
ofs->whiteout->d_inode->i_nlink,
PTR_ERR(whiteout));
ofs->no_shared_whiteout = true;
}
}