ksmbd: fix oops from fuse driver

Marios reported kernel oops from fuse driver when ksmbd call
mark_inode_dirty(). This patch directly update ->i_ctime after removing
mark_inode_ditry() and notify_change will put inode to dirty list.

Cc: Tom Talpey <tom@talpey.com>
Cc: Ronnie Sahlberg <ronniesahlberg@gmail.com>
Cc: Ralph Böhme <slow@samba.org>
Cc: Hyunchul Lee <hyc.lee@gmail.com>
Reported-by: Marios Makassikis <mmakassikis@freebox.fr>
Tested-by: Marios Makassikis <mmakassikis@freebox.fr>
Acked-by: Hyunchul Lee <hyc.lee@gmail.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>

authored by Namjae Jeon and committed by Steve French 64e78755 2db72604

+6 -11
+6 -11
fs/ksmbd/smb2pdu.c
··· 5483 5483 struct ksmbd_share_config *share) 5484 5484 { 5485 5485 struct iattr attrs; 5486 - struct timespec64 ctime; 5487 5486 struct file *filp; 5488 5487 struct inode *inode; 5489 5488 struct user_namespace *user_ns; ··· 5504 5505 attrs.ia_valid |= (ATTR_ATIME | ATTR_ATIME_SET); 5505 5506 } 5506 5507 5507 - if (file_info->ChangeTime) { 5508 + attrs.ia_valid |= ATTR_CTIME; 5509 + if (file_info->ChangeTime) 5508 5510 attrs.ia_ctime = ksmbd_NTtimeToUnix(file_info->ChangeTime); 5509 - ctime = attrs.ia_ctime; 5510 - attrs.ia_valid |= ATTR_CTIME; 5511 - } else { 5512 - ctime = inode->i_ctime; 5513 - } 5511 + else 5512 + attrs.ia_ctime = inode->i_ctime; 5514 5513 5515 5514 if (file_info->LastWriteTime) { 5516 5515 attrs.ia_mtime = ksmbd_NTtimeToUnix(file_info->LastWriteTime); ··· 5554 5557 return -EACCES; 5555 5558 5556 5559 inode_lock(inode); 5560 + inode->i_ctime = attrs.ia_ctime; 5561 + attrs.ia_valid &= ~ATTR_CTIME; 5557 5562 rc = notify_change(user_ns, dentry, &attrs, NULL); 5558 - if (!rc) { 5559 - inode->i_ctime = ctime; 5560 - mark_inode_dirty(inode); 5561 - } 5562 5563 inode_unlock(inode); 5563 5564 } 5564 5565 return rc;