linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH 0/6] btrfs send stream version 2
@ 2018-05-09  2:06 Howard McLauchlan
  2018-05-09  2:06 ` [RFC PATCH 1/6] btrfs: send, bump stream version Howard McLauchlan
                   ` (5 more replies)
  0 siblings, 6 replies; 10+ messages in thread
From: Howard McLauchlan @ 2018-05-09  2:06 UTC (permalink / raw)
  To: linux-btrfs
  Cc: Chris Mason, Josef Bacik, David Sterba, Filipe Manana,
	Omar Sandoval, Howard McLauchlan

In trying to implement support for inode flags in send/receive, the need for
proper versioning/compatibility came up. I found some of Filipe's old patches
[1] for send stream v2 and rebased them on 4.17-rc4. My chattr changes are
landed on top and also gated behind send stream v2. Similar was done for
btrfs-progs (v4.16.1) [2] and a relevant xfstest (master) [3].

Unfortunately, since Filipe's changes are about 4 years old, rebasing required
quite a few "I guess this is how it works" guesses. A critical eye would be
greatly appreciated.

As of 4.17-rc4, commit a6aa10c70bf7 ("Btrfs: send, fix missing truncate for
inode with prealloc extent past eof") is causing some strange behaviour with the
rebased changes (this can be best seen in the xfstest output for btrfs/160).
Specifically, the hole/data structure is consistent between sender/receiver, but
the receiver is missing some information in fiemap for prealloc extents past
eof. Filipe mentioned that his fix was considering the lack of fallocate command
in send, so that's something we can look at if this patch set gets anywhere.

A few things I was unsure about:

- I couldn't use open_inode_for_write() in process_chattr() in btrfs-progs.
  Ended up having to open() with O_RDONLY. This is probably because I was
  setting immutable on the inode for my test cases.
- Filipe's original patches had BTRFS_SEND_{A/C}_INODE_FLAGS as placeholders,
  but I'd already implemented everything as BTRFS_SEND_{A/C}_CHATTR, since
  send_chown(), send_chmod(), etc. seemed to set a precedent in naming. If this
  needs to be changed let me know:

As of v4.17-rc4, these changes pass all "send" group xfstests.

Cheers, Howard

1: https://www.spinics.net/lists/linux-btrfs/msg35169.html
2: https://patchwork.kernel.org/patch/4021491/
3: https://patchwork.kernel.org/patch/4004861/

Filipe David Borba Manana (5):
  btrfs: send, bump stream version
  btrfs: send, implement total data size command to allow for progress
    estimation
  btrfs: send, use fallocate command to punch holes
  btrfs: send, use fallocate command to allocate extents
  btrfs: add send_stream_version attribute to sysfs

Howard McLauchlan (1):
  btrfs: add chattr support for send/receive

 fs/btrfs/ctree.h           |   2 +
 fs/btrfs/ioctl.c           |   2 +-
 fs/btrfs/send.c            | 496 +++++++++++++++++++++++++++++++------
 fs/btrfs/send.h            |  26 +-
 fs/btrfs/sysfs.c           |  29 +++
 include/uapi/linux/btrfs.h |  21 +-
 6 files changed, 495 insertions(+), 81 deletions(-)

-- 
2.17.0


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2018-05-16 19:04 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-05-09  2:06 [RFC PATCH 0/6] btrfs send stream version 2 Howard McLauchlan
2018-05-09  2:06 ` [RFC PATCH 1/6] btrfs: send, bump stream version Howard McLauchlan
2018-05-16 18:25   ` Omar Sandoval
2018-05-09  2:06 ` [RFC PATCH 2/6] btrfs: send, implement total data size command to allow for progress estimation Howard McLauchlan
2018-05-09  2:06 ` [RFC PATCH 3/6] btrfs: send, use fallocate command to punch holes Howard McLauchlan
2018-05-09  2:06 ` [RFC PATCH 4/6] btrfs: send, use fallocate command to allocate extents Howard McLauchlan
2018-05-09  2:06 ` [RFC PATCH 5/6] btrfs: add send_stream_version attribute to sysfs Howard McLauchlan
2018-05-16 19:04   ` Omar Sandoval
2018-05-09  2:06 ` [RFC PATCH 6/6] btrfs: add chattr support for send/receive Howard McLauchlan
2018-05-16 18:59   ` Omar Sandoval

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).