]> www.infradead.org Git - linux-platform-drivers-x86.git/commit
do_cifs_create(): don't set ->i_mode of something we had not created
authorAl Viro <viro@zeniv.linux.org.uk>
Thu, 11 Feb 2021 20:04:35 +0000 (15:04 -0500)
committerAl Viro <viro@zeniv.linux.org.uk>
Sat, 13 Mar 2021 03:15:19 +0000 (22:15 -0500)
commit4ab5260dab28109979a1b47a8996c9922219927f
tree05f8487a30f398b3faf014d0d0860aa4108bf769
parent4a378d8a0d9606e97bddb0389cbc2009c6fc006c
do_cifs_create(): don't set ->i_mode of something we had not created

If the file had existed before we'd called ->atomic_open() (without
O_EXCL, that is), we have no more business setting ->i_mode than
we would setting ->i_uid or ->i_gid.  We also have no business
doing either if another client has managed to get unlink+mkdir
between ->open() and cifs_inode_get_info().

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/cifs/dir.c