All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: Jeremy Allison <jra@samba.org>
To: Ralph Boehme <slow@samba.org>
Cc: Steve French <smfrench@gmail.com>,
	CIFS <linux-cifs@vger.kernel.org>,
	samba-technical <samba-technical@lists.samba.org>
Subject: Re: Samba ctime still reported incorrectly
Date: Mon, 29 Apr 2024 10:17:03 -0700	[thread overview]
Message-ID: <Zi/WD7EsxMBilrT0@jeremy-HP-Z840-Workstation> (raw)
In-Reply-To: <b40a9f3b-6d2d-4ddc-9ca3-9d8bb21ee0b9@samba.org>

On Mon, Apr 29, 2024 at 10:51:21AM +0200, Ralph Boehme wrote:
>Hi Steve,
>
>On 4/28/24 9:41 PM, Steve French via samba-technical wrote:
>>I did another test of the Samba server ctime bug on Samba master
>>(4.21.0pre1) and Samba server is still broken in how it reports ctime.
>>An example scenario is simple, creating a hardlink is supposed to
>>update ctime on a file (and this works fine to Windows server and
>>ksmbd etc) but Samba server mistakenly reports ctime as mtime (unless
>>you mount with the "posix" mount option).  This e.g. breaks xfstest
>>generic/236 when run to Samba
>>
>>More information is at:
>>https://bugzilla.samba.org/show_bug.cgi?id=10883
>
>I wonder if this is a bug going back as far as 
>c9dca82ed7757f4745edf6ee6048bd94d86c4dbc
>
>@Jeremy: do you remember why you chose to return mtime in 
>get_change_timespec() and not ctime?

If you look closely at that commit, you'll see
that it's actually not changing the logic that
previously existed :-).

-       put_long_date_timespec(p, m_timespec); /* change time */
+       put_long_date_timespec(p, c_timespec); /* change time */

Previously we were using m_timespec as change time,
and c_timespec in this change now comes from:

+       c_timespec = get_change_timespec(fsp, smb_fname);

+struct timespec get_change_timespec(struct files_struct *fsp,
+                               const struct smb_filename *smb_fname)
+{
+       return smb_fname->st.st_ex_mtime;
+}

So I actually wasn't changing what we already were
doing :-).

Now as to *why* we were using m_time instead of c_time,
my guess is that we were trying to emulate NTFS
semantics which were not documented or well understood at the
time (where "the time" is probably prior to 2009 :-).

  reply	other threads:[~2024-04-29 17:17 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-28 19:41 Samba ctime still reported incorrectly Steve French
2024-04-29  8:51 ` Ralph Boehme
2024-04-29 17:17   ` Jeremy Allison [this message]
2024-04-29 19:27     ` Ralph Boehme
2024-04-29 19:59       ` Jeremy Allison
2024-04-29 20:16         ` Steve French
2024-04-29 20:46           ` Jeremy Allison
2024-04-29 22:53             ` Steve French
2024-04-30  8:45       ` Ralph Boehme

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=Zi/WD7EsxMBilrT0@jeremy-HP-Z840-Workstation \
    --to=jra@samba.org \
    --cc=linux-cifs@vger.kernel.org \
    --cc=samba-technical@lists.samba.org \
    --cc=slow@samba.org \
    --cc=smfrench@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.