Linux CIFS filesystem development
 help / color / mirror / Atom feed
From: David Disseldorp <ddiss@suse.de>
To: Namjae Jeon <linkinjeon@kernel.org>
Cc: linux-cifs@vger.kernel.org, smfrench@gmail.com,
	senozhatsky@chromium.org, tom@talpey.com,
	atteh.mailbox@gmail.com
Subject: Re: [PATCH] ksmbd: set ATTR_CTIME flags when setting mtime
Date: Tue, 10 Dec 2024 16:02:30 +1100	[thread overview]
Message-ID: <20241210160230.5318c4a9.ddiss@suse.de> (raw)
In-Reply-To: <20241206153858.12505-1-linkinjeon@kernel.org>

Hi Namjae,

On Sat,  7 Dec 2024 00:38:58 +0900, Namjae Jeon wrote:
...
>  fs/smb/server/smb2pdu.c | 10 +++-------
>  1 file changed, 3 insertions(+), 7 deletions(-)
> 
> diff --git a/fs/smb/server/smb2pdu.c b/fs/smb/server/smb2pdu.c
> index 5a70df87074c..803b35b89513 100644
> --- a/fs/smb/server/smb2pdu.c
> +++ b/fs/smb/server/smb2pdu.c
> @@ -6026,15 +6026,13 @@ static int set_file_basic_info(struct ksmbd_file *fp,
>  		attrs.ia_valid |= (ATTR_ATIME | ATTR_ATIME_SET);
>  	}
>  
> -	attrs.ia_valid |= ATTR_CTIME;

This will mean that we now only call through to notify_change() on atime
or mtime updates, which doesn't seem right. Can we get here with a valid
file_info->ChangeTime only (i.e. no atime/mtime change)?

>  	if (file_info->ChangeTime)
> -		attrs.ia_ctime = ksmbd_NTtimeToUnix(file_info->ChangeTime);
> -	else
> -		attrs.ia_ctime = inode_get_ctime(inode);
> +		inode_set_ctime_to_ts(inode,
> +				ksmbd_NTtimeToUnix(file_info->ChangeTime));
>  
>  	if (file_info->LastWriteTime) {
>  		attrs.ia_mtime = ksmbd_NTtimeToUnix(file_info->LastWriteTime);
> -		attrs.ia_valid |= (ATTR_MTIME | ATTR_MTIME_SET);
> +		attrs.ia_valid |= (ATTR_MTIME | ATTR_MTIME_SET | ATTR_CTIME);
>  	}
>  
>  	if (file_info->Attributes) {
> @@ -6076,8 +6074,6 @@ static int set_file_basic_info(struct ksmbd_file *fp,
>  			return -EACCES;
>  
>  		inode_lock(inode);
> -		inode_set_ctime_to_ts(inode, attrs.ia_ctime);
> -		attrs.ia_valid &= ~ATTR_CTIME;
>  		rc = notify_change(idmap, dentry, &attrs, NULL);
>  		inode_unlock(inode);
>  	}


  reply	other threads:[~2024-12-10  5:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-06 15:38 [PATCH] ksmbd: set ATTR_CTIME flags when setting mtime Namjae Jeon
2024-12-10  5:02 ` David Disseldorp [this message]
2024-12-10  7:53   ` Namjae Jeon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241210160230.5318c4a9.ddiss@suse.de \
    --to=ddiss@suse.de \
    --cc=atteh.mailbox@gmail.com \
    --cc=linkinjeon@kernel.org \
    --cc=linux-cifs@vger.kernel.org \
    --cc=senozhatsky@chromium.org \
    --cc=smfrench@gmail.com \
    --cc=tom@talpey.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox