From: "Darrick J. Wong" <djwong@kernel.org>
To: Christoph Hellwig <hch@infradead.org>
Cc: Jeff Layton <jlayton@kernel.org>,
hch@lst.de, linux-xfs@vger.kernel.org,
linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH 1/1] xfs: introduce new file range commit ioctls
Date: Fri, 23 Aug 2024 21:46:43 -0700 [thread overview]
Message-ID: <20240824044643.GS865349@frogsfrogsfrogs> (raw)
In-Reply-To: <ZslTjr9P-2JUKVg7@infradead.org>
On Fri, Aug 23, 2024 at 08:29:18PM -0700, Christoph Hellwig wrote:
> On Fri, Aug 23, 2024 at 10:41:40AM -0700, Darrick J. Wong wrote:
> > <nod> If these both get merged for 6.12, I think the appropriate port
> > for this patch is to change xfs_ioc_start_commit to do:
> >
> > struct kstat kstat;
> >
> > fill_mg_cmtime(&kstat, STATX_CTIME | STATX_MTIME, XFS_I(ip2));
> > kern_f->file2_ctime = kstat.ctime.tv_sec;
> > kern_f->file2_ctime_nsec = kstat.ctime.tv_nsec;
> > kern_f->file2_mtime = kstat.mtime.tv_sec;
> > kern_f->file2_mtime_nsec = kstat.mtime.tv_nsec;
> >
> > instead of open-coding the inode_get_[cm]time calls. The entire
> > exchangerange feature is still marked experimental, so I didn't think it
> > was worth rebasing my entire dev branch on the multigrain timestamp
> > redux series; we can just fix it later.
>
> But the commit log could really note this dependency. This will be
> especially useful for backports, but also for anyone reading through
> code history.
Ok, how about this for a commit message:
"This patch introduces two more new ioctls to manage atomic updates to
file contents -- XFS_IOC_START_COMMIT and XFS_IOC_COMMIT_RANGE. The
commit mechanism here is exactly the same as what XFS_IOC_EXCHANGE_RANGE
does, but with the additional requirement that file2 cannot have changed
since some sampling point. The start-commit ioctl performs the sampling
of file attributes.
"Note: This patch currently samples i_ctime during START_COMMIT and
checks that it hasn't changed during COMMIT_RANGE. This isn't entirely
safe in kernels prior to 6.12 because ctime only had coarse grained
granularity and very fast updates could collide with a COMMIT_RANGE.
With the multi-granularity ctime introduced in that release by Jeff
Layton, it's now possible to update ctime such that this does not
happen.
"It is critical, then, that this patch must not be backported to any
kernel that does not support fine-grained file change timestamps."
Will that pass muster?
--D
next prev parent reply other threads:[~2024-08-24 4:46 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20240822235230.GJ6043@frogsfrogsfrogs>
2024-08-22 23:56 ` [PATCHSET v31.0 02/10] xfs: atomic file content commits Darrick J. Wong
2024-08-23 0:01 ` [PATCH 1/1] xfs: introduce new file range commit ioctls Darrick J. Wong
2024-08-23 4:12 ` Christoph Hellwig
2024-08-23 13:20 ` Jeff Layton
2024-08-23 17:41 ` Darrick J. Wong
2024-08-23 19:15 ` Jeff Layton
2024-08-24 3:29 ` Christoph Hellwig
2024-08-24 4:46 ` Darrick J. Wong [this message]
2024-08-24 4:48 ` Christoph Hellwig
2024-08-24 6:29 ` [PATCH v31.0.1 " Darrick J. Wong
2024-08-24 12:11 ` Jeff Layton
2024-08-25 4:52 ` Christoph Hellwig
2024-08-22 23:58 ` [PATCHSET v4.0 08/10] xfs: preparation for realtime allocation groups Darrick J. Wong
2024-08-23 0:21 ` [PATCH 1/1] iomap: add a merge boundary flag Darrick J. Wong
2024-09-02 18:21 [PATCHSET v31.1 1/8] xfs: atomic file content commits Darrick J. Wong
2024-09-02 18:23 ` [PATCH 1/1] xfs: introduce new file range commit ioctls Darrick J. Wong
2024-09-03 7:52 ` Christian Brauner
2024-10-25 21:23 ` Darrick J. Wong
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=20240824044643.GS865349@frogsfrogsfrogs \
--to=djwong@kernel.org \
--cc=hch@infradead.org \
--cc=hch@lst.de \
--cc=jlayton@kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-xfs@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).