@@ -5483,7 +5483,6 @@ static int set_file_basic_info(struct ksmbd_file *fp,
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 ;
@@ -5505,13 +5504,11 @@ static int set_file_basic_info(struct ksmbd_file *fp,
5505
5504
attrs .ia_valid |= (ATTR_ATIME | ATTR_ATIME_SET );
5506
5505
}
5507
5506
5508
- if (file_info -> ChangeTime ) {
5507
+ attrs .ia_valid |= ATTR_CTIME ;
5508
+ if (file_info -> ChangeTime )
5509
5509
attrs .ia_ctime = ksmbd_NTtimeToUnix (file_info -> ChangeTime );
5510
- ctime = attrs .ia_ctime ;
5511
- attrs .ia_valid |= ATTR_CTIME ;
5512
- } else {
5513
- ctime = inode -> i_ctime ;
5514
- }
5510
+ else
5511
+ attrs .ia_ctime = inode -> i_ctime ;
5515
5512
5516
5513
if (file_info -> LastWriteTime ) {
5517
5514
attrs .ia_mtime = ksmbd_NTtimeToUnix (file_info -> LastWriteTime );
@@ -5557,11 +5554,9 @@ static int set_file_basic_info(struct ksmbd_file *fp,
5557
5554
return - EACCES ;
5558
5555
5559
5556
inode_lock (inode );
5557
+ inode -> i_ctime = attrs .ia_ctime ;
5558
+ attrs .ia_valid &= ~ATTR_CTIME ;
5560
5559
rc = notify_change (user_ns , dentry , & attrs , NULL );
5561
- if (!rc ) {
5562
- inode -> i_ctime = ctime ;
5563
- mark_inode_dirty (inode );
5564
- }
5565
5560
inode_unlock (inode );
5566
5561
}
5567
5562
return rc ;
0 commit comments