From: Antonio Quartulli Date: Mon, 21 Jul 2025 20:38:21 +0000 (+0200) Subject: ovl: properly print correct variable X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=672820a070ea5e6ae114f6109726a4e18313a527;p=thirdparty%2Fkernel%2Flinux.git 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: 8afa0a7367138 ("ovl: narrow locking in ovl_whiteout()") Signed-off-by: Antonio Quartulli Link: https://lore.kernel.org/20250721203821.7812-1-antonio@mandelbit.com Reviewed-by: NeilBrown Signed-off-by: Christian Brauner --- diff --git a/fs/overlayfs/dir.c b/fs/overlayfs/dir.c index 30619777f0f68..70b8687dc45e8 100644 --- a/fs/overlayfs/dir.c +++ b/fs/overlayfs/dir.c @@ -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; } }