Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ovl: pass name buffer to ovl_start_creating_temp()

Now ovl_start_creating_temp() is passed a buffer in which to store the
temp name. This will be useful in a future patch were ovl_create_real()
will need access to that name.

Reviewed-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: NeilBrown <neil@brown.name>
Link: https://patch.msgid.link/20260224222542.3458677-12-neilb@ownmail.net
Signed-off-by: Christian Brauner <brauner@kernel.org>

authored by

NeilBrown and committed by
Christian Brauner
85bb1420 deef0499

+8 -6
+8 -6
fs/overlayfs/dir.c
··· 66 66 } 67 67 68 68 static struct dentry *ovl_start_creating_temp(struct ovl_fs *ofs, 69 - struct dentry *workdir) 69 + struct dentry *workdir, 70 + char name[OVL_TEMPNAME_SIZE]) 70 71 { 71 - char name[OVL_TEMPNAME_SIZE]; 72 - 73 72 ovl_tempname(name); 74 73 return start_creating(ovl_upper_mnt_idmap(ofs), workdir, 75 74 &QSTR(name)); ··· 80 81 struct dentry *whiteout, *link; 81 82 struct dentry *workdir = ofs->workdir; 82 83 struct inode *wdir = workdir->d_inode; 84 + char name[OVL_TEMPNAME_SIZE]; 83 85 84 86 guard(mutex)(&ofs->whiteout_lock); 85 87 86 88 if (!ofs->whiteout) { 87 - whiteout = ovl_start_creating_temp(ofs, workdir); 89 + whiteout = ovl_start_creating_temp(ofs, workdir, name); 88 90 if (IS_ERR(whiteout)) 89 91 return whiteout; 90 92 err = ovl_do_whiteout(ofs, wdir, whiteout); ··· 97 97 } 98 98 99 99 if (!ofs->no_shared_whiteout) { 100 - link = ovl_start_creating_temp(ofs, workdir); 100 + link = ovl_start_creating_temp(ofs, workdir, name); 101 101 if (IS_ERR(link)) 102 102 return link; 103 103 err = ovl_do_link(ofs, ofs->whiteout, wdir, link); ··· 247 247 struct ovl_cattr *attr) 248 248 { 249 249 struct dentry *ret; 250 - ret = ovl_start_creating_temp(ofs, workdir); 250 + char name[OVL_TEMPNAME_SIZE]; 251 + 252 + ret = ovl_start_creating_temp(ofs, workdir, name); 251 253 if (IS_ERR(ret)) 252 254 return ret; 253 255 ret = ovl_create_real(ofs, workdir, ret, attr);