mirror_zfs/module
Antonio Russo f8ce8aed0c
Set file mode during zfs_write
3d40b65 refactored zfs_vnops.c, which shared much code verbatim between
Linux and BSD.  After a successful write, the suid/sgid bits are reset,
and the mode to be written is stored in newmode.  On Linux, this was
propagated to both the in-memory inode and znode, which is then updated
with sa_update.

3d40b65 accidentally removed the initialization of newmode, which
happened to occur on the same line as the inode update (which has been
moved out of the function).

The uninitialized newmode can be saved to disk, leading to a crash on
stat() of that file, in addition to a merely incorrect file mode.

Reviewed-by: Ryan Moeller <ryan@ixsystems.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Antonio Russo <aerusso@aerusso.net>
Closes #11474 
Closes #11576
2021-02-08 09:15:05 -08:00
..
avl cppcheck: remove redundant ASSERTs 2021-01-26 16:12:10 -08:00
icp Extending FreeBSD UIO Struct 2021-01-20 21:27:30 -08:00
lua cppcheck: integrete cppcheck 2021-01-26 16:12:26 -08:00
nvpair Links in Source Files 2020-09-02 09:42:12 -07:00
os fix abd_nr_pages_off for gang abd 2021-01-28 09:28:20 -08:00
spl Cleanup linux module kbuild files 2020-06-10 09:24:15 -07:00
unicode Throw const on some strings 2020-10-02 17:44:10 -07:00
zcommon Linux 5.10 compat: use iov_iter in uio structure 2020-12-18 08:48:26 -08:00
zfs Set file mode during zfs_write 2021-02-08 09:15:05 -08:00
zstd Optimize locking checks in mempool allocator 2020-11-02 12:10:07 -08:00
.gitignore Cleanup linux module kbuild files 2020-06-10 09:24:15 -07:00
Kbuild.in Add zstd support to zfs 2020-08-20 10:30:06 -07:00
Makefile.bsd FreeBSD: decouple ZFS_DEBUG from kernel debug settings 2020-11-24 09:16:46 -08:00
Makefile.in cppcheck: integrete cppcheck 2021-01-26 16:12:26 -08:00