Skip to content

Commit 85bb142

Browse files
neilbrownbrauner
authored andcommitted
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>
1 parent deef049 commit 85bb142

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

fs/overlayfs/dir.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,9 @@ void ovl_tempname(char name[OVL_TEMPNAME_SIZE])
6666
}
6767

6868
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])
7071
{
71-
char name[OVL_TEMPNAME_SIZE];
72-
7372
ovl_tempname(name);
7473
return start_creating(ovl_upper_mnt_idmap(ofs), workdir,
7574
&QSTR(name));
@@ -81,11 +80,12 @@ static struct dentry *ovl_whiteout(struct ovl_fs *ofs)
8180
struct dentry *whiteout, *link;
8281
struct dentry *workdir = ofs->workdir;
8382
struct inode *wdir = workdir->d_inode;
83+
char name[OVL_TEMPNAME_SIZE];
8484

8585
guard(mutex)(&ofs->whiteout_lock);
8686

8787
if (!ofs->whiteout) {
88-
whiteout = ovl_start_creating_temp(ofs, workdir);
88+
whiteout = ovl_start_creating_temp(ofs, workdir, name);
8989
if (IS_ERR(whiteout))
9090
return whiteout;
9191
err = ovl_do_whiteout(ofs, wdir, whiteout);
@@ -97,7 +97,7 @@ static struct dentry *ovl_whiteout(struct ovl_fs *ofs)
9797
}
9898

9999
if (!ofs->no_shared_whiteout) {
100-
link = ovl_start_creating_temp(ofs, workdir);
100+
link = ovl_start_creating_temp(ofs, workdir, name);
101101
if (IS_ERR(link))
102102
return link;
103103
err = ovl_do_link(ofs, ofs->whiteout, wdir, link);
@@ -247,7 +247,9 @@ struct dentry *ovl_create_temp(struct ovl_fs *ofs, struct dentry *workdir,
247247
struct ovl_cattr *attr)
248248
{
249249
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);
251253
if (IS_ERR(ret))
252254
return ret;
253255
ret = ovl_create_real(ofs, workdir, ret, attr);

0 commit comments

Comments
 (0)