diff --git a/fs/incfs/pseudo_files.c b/fs/incfs/pseudo_files.c index ff4cb941a1d8..e51621fbf1af 100644 --- a/fs/incfs/pseudo_files.c +++ b/fs/incfs/pseudo_files.c @@ -863,6 +863,12 @@ static long ioctl_create_mapped_file(struct file *file, void __user *arg) if (error) goto out; + error = chmod(file_dentry, args.mode | 0222); + if (error) { + pr_debug("incfs: chmod err: %d\n", error); + goto delete_file; + } + /* Save the file's size as an xattr for easy fetching in future. */ size_attr_value = cpu_to_le64(args.size); error = vfs_setxattr(file_dentry, INCFS_XATTR_SIZE_NAME,