ovl: fix debug print in case of mkdir error
authorAmir Goldstein <amir73il@gmail.com>
Thu, 12 Jun 2025 07:22:45 +0000 (09:22 +0200)
committerChristian Brauner <brauner@kernel.org>
Thu, 12 Jun 2025 12:25:24 +0000 (14:25 +0200)
We want to print the name in case of mkdir failure and now we will
get a cryptic (efault) as name.

Fixes: c54b386969a5 ("VFS: Change vfs_mkdir() to return the dentry.")
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Link: https://lore.kernel.org/20250612072245.2825938-1-amir73il@gmail.com
Signed-off-by: Christian Brauner <brauner@kernel.org>
fs/overlayfs/overlayfs.h

index 8baaba0a3fe59ee8f9ca2c4cb230b66385dff8ed..497323128e5fcc39f65ceecd75ebf3649d78f206 100644 (file)
@@ -246,9 +246,11 @@ static inline struct dentry *ovl_do_mkdir(struct ovl_fs *ofs,
                                          struct dentry *dentry,
                                          umode_t mode)
 {
-       dentry = vfs_mkdir(ovl_upper_mnt_idmap(ofs), dir, dentry, mode);
-       pr_debug("mkdir(%pd2, 0%o) = %i\n", dentry, mode, PTR_ERR_OR_ZERO(dentry));
-       return dentry;
+       struct dentry *ret;
+
+       ret = vfs_mkdir(ovl_upper_mnt_idmap(ofs), dir, dentry, mode);
+       pr_debug("mkdir(%pd2, 0%o) = %i\n", dentry, mode, PTR_ERR_OR_ZERO(ret));
+       return ret;
 }
 
 static inline int ovl_do_mknod(struct ovl_fs *ofs,