ksmbd: remove setattr preparations in set_file_basic_info()
authorChristian Brauner <christian.brauner@ubuntu.com>
Thu, 26 Aug 2021 01:07:05 +0000 (10:07 +0900)
committerSteve French <stfrench@microsoft.com>
Sat, 4 Sep 2021 04:29:45 +0000 (23:29 -0500)
commitdb7fb6fe3d7a8eb05f2b74c6252771c9362f3b74
tree1fd4ac4ed92908c911947c4937ef96876da31ff3
parenteb5784f0c6efbe0db720ad7e34e097cea51c1afc
ksmbd: remove setattr preparations in set_file_basic_info()

Permission checking and copying over ownership information is the task
of the underlying filesystem not ksmbd. The order is also wrong here.
This modifies the inode before notify_change(). If notify_change() fails
this will have changed ownership nonetheless. All of this is unnecessary
though since the underlying filesystem's ->setattr handler will do all
this (if required) by itself.

Cc: Steve French <stfrench@microsoft.com>
Cc: Christoph Hellwig <hch@infradead.org>
Cc: Namjae Jeon <namjae.jeon@samsung.com>
Cc: Hyunchul Lee <hyc.lee@gmail.com>
Cc: Sergey Senozhatsky <senozhatsky@chromium.org>
Cc: linux-cifs@vger.kernel.org
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/ksmbd/smb2pdu.c