Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linux: zpl_tmpfile: ensure ACL init succeeds before d_tmpfile #16625

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions module/os/linux/zfs/zpl_inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -317,19 +317,19 @@ zpl_tmpfile(struct inode *dir, struct dentry *dentry, umode_t mode)
/* d_tmpfile will do drop_nlink, so we should set it first */
set_nlink(ip, 1);
#ifndef HAVE_TMPFILE_DENTRY
d_tmpfile(file, ip);

error = zpl_xattr_security_init(ip, dir,
&file->f_path.dentry->d_name);
if (error == 0)
error = zpl_init_acl(ip, dir);
if (error == 0)
d_tmpfile(file, ip);
error = finish_open_simple(file, error);
#else
d_tmpfile(dentry, ip);

error = zpl_xattr_security_init(ip, dir, &dentry->d_name);
#endif
if (error == 0)
error = zpl_init_acl(ip, dir);
#ifndef HAVE_TMPFILE_DENTRY
error = finish_open_simple(file, error);
if (error == 0)
d_tmpfile(dentry, ip);
#endif
/*
* don't need to handle error here, file is already in
Expand Down
Loading