Skip to content

Commit

Permalink
Don't fail to umask for O_TMPFILE files
Browse files Browse the repository at this point in the history
Update ->i_mode with umask for O_TMPFILE files.

(Note that zpl_init_acl() will return 0 without
`ip->i_mode &= ~current_umask();` if not POSIX ACL.)

Signed-off-by: Tomohiro Kusumi <[email protected]>
  • Loading branch information
kusumi committed Jul 7, 2019
1 parent 1086f54 commit 104b9d2
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions module/zfs/zpl_inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ zpl_tmpfile(struct inode *dir, struct dentry *dentry, zpl_umode_t mode)
cookie = spl_fstrans_mark();
error = -zfs_tmpfile(dir, vap, 0, mode, &ip, cr, 0, NULL);
if (error == 0) {
ip->i_mode &= ~current_umask();
/* d_tmpfile will do drop_nlink, so we should set it first */
set_nlink(ip, 1);
d_tmpfile(dentry, ip);
Expand Down

0 comments on commit 104b9d2

Please sign in to comment.