Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: intelfx@intelfx.name
Cc: Qu Wenruo <wqu@suse.com>, Qu Wenruo <quwenruo.btrfs@gmx.com>,
	linux-btrfs@vger.kernel.org
Subject: Re: What's the difference between `btrfs sub del -c` and `btrfs fi sync`?
Date: Thu, 2 May 2024 15:16:40 +0200	[thread overview]
Message-ID: <20240502131640.GQ2585@twin.jikos.cz> (raw)
In-Reply-To: <18c138d9f3e8fe3a040d8a3f284317267e417136.camel@intelfx.name>

On Sun, Apr 28, 2024 at 12:20:28PM +0200, intelfx@intelfx.name wrote:
> I see, thanks. That's what I suspected, but wanted to check if my
> (limited) understanding was correct.
> 
> It is unfortunate that ioctls that should be equivalent if judging by
> the names alone, in fact have subtle semantic differences that aren't
> documented anywhere.

Ioctls get documented incrementally, at least the FS SYNC is there,
https://btrfs.readthedocs.io/en/latest/btrfs-ioctl.html#btrfs-ioc-sync

> It's as if the ioctls were introduced specifically
> for the relevant userspace tools, encoding specific assumptions valid
> for their (only) consumers, without consideration of their wider
> applicability...

The start/wait ioctls can be used for cases when there's first phase
that generates some data or changes and second phase waits for the
commit. It was convenient to use that for the subvol sync, can be used
for other changes that eg. do only btrfs_end_transaction() in kernel
while some sort of sync semantics is wanted from user space (that would
be equivalent to btrfs_commit_transaction()).

You can read the discussions behind that in
https://www.spinics.net/lists/linux-btrfs/msg28354.html

The semantics of the start/wait ioctls were explained in the initial
patch https://git.kernel.org/linus/462045928bda777c86919a396a42991fcf235378
originally added for ceph.

      reply	other threads:[~2024-05-02 13:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-26 22:52 What's the difference between `btrfs sub del -c` and `btrfs fi sync`? intelfx
2024-04-26 23:06 ` Qu Wenruo
2024-04-26 23:14   ` intelfx
2024-04-27  0:04     ` Qu Wenruo
2024-04-28 10:20       ` intelfx
2024-05-02 13:16         ` David Sterba [this message]

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=20240502131640.GQ2585@twin.jikos.cz \
    --to=dsterba@suse.cz \
    --cc=intelfx@intelfx.name \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=quwenruo.btrfs@gmx.com \
    --cc=wqu@suse.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