linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/6] FSID change kernel support
@ 2018-10-11 15:03 Nikolay Borisov
  2018-10-11 15:03 ` [PATCH 1/6] btrfs: Introduce support for FSID change without metadata rewrite Nikolay Borisov
                   ` (6 more replies)
  0 siblings, 7 replies; 11+ messages in thread
From: Nikolay Borisov @ 2018-10-11 15:03 UTC (permalink / raw)
  To: linux-btrfs; +Cc: Nikolay Borisov

Hello, 

Here is the second posting of the fsid change support for the kernel. For 
background information you can refer to v1 [0]. The main changes in this version
are around the handling of possible split-brain scenarios. I've changed a bit 
how the userspace code works and now the process is split among 2 transactions. 
The first one flagging "we are about to change fsid" and once it's persisted on
all disks a second one does the actual change. This of course is not enough 
to guarantee full consistency so I had to extend the device scanning to 
gracefully handle such cases. I believe I have covered everything but more 
review will be appreciated. 

So patch 1 implements the basic functionality with no split-brain handling 
whatsoever. Patch 2 is a minor cleanup. Patch 3 deals with a split-brain that 
can occur if power loss happens during the initial transaction (the one setting
the beginning flag). Patch 4 adds some information that is needed in the last 2 
patches. Patch 5 handles failure between transaction 1 and transaction 2 and 
finally patch 6 handles the case of power loss during transaction 1 but for an 
fs which has already undergone at least one successful fsid change. More 
details about the exact failure modes are in each respective patch.

One thing which could be improved but I ran out of ideas is the naming of the 
ancillary functions - find_fsid_inprogress and find_fsid_changed. 


I've actually tested the split-brain handing code with specially crafted images. 
They will be part of the user-space submissions and I believe I have full 
coverage for that. 

[0] https://lore.kernel.org/linux-btrfs/1535531774-29830-1-git-send-email-nborisov@suse.com/

Nikolay Borisov (6):
  btrfs: Introduce support for FSID change without metadata rewrite
  btrfs: Remove fsid/metadata_fsid fields from btrfs_info
  btrfs: Add handling for disk split-brain scenario during fsid change
  btrfs: Introduce 2 more members to struct btrfs_fs_devices
  btrfs: Handle one more split-brain scenario during fsid change
  btrfs: Handle final split-brain possibility during fsid change

 fs/btrfs/check-integrity.c      |   2 +-
 fs/btrfs/ctree.c                |   5 +-
 fs/btrfs/ctree.h                |  10 +-
 fs/btrfs/disk-io.c              |  53 ++++++++---
 fs/btrfs/extent-tree.c          |   2 +-
 fs/btrfs/ioctl.c                |   2 +-
 fs/btrfs/super.c                |   2 +-
 fs/btrfs/volumes.c              | 196 ++++++++++++++++++++++++++++++++++++----
 fs/btrfs/volumes.h              |   6 ++
 include/trace/events/btrfs.h    |   2 +-
 include/uapi/linux/btrfs.h      |   1 +
 include/uapi/linux/btrfs_tree.h |   1 +
 12 files changed, 241 insertions(+), 41 deletions(-)

-- 
2.7.4


^ permalink raw reply	[flat|nested] 11+ messages in thread
* [PATCH v3 0/6] FSID change kernel support
@ 2018-10-30 14:43 Nikolay Borisov
  2018-10-30 14:43 ` [PATCH 2/6] btrfs: Remove fsid/metadata_fsid fields from btrfs_info Nikolay Borisov
  0 siblings, 1 reply; 11+ messages in thread
From: Nikolay Borisov @ 2018-10-30 14:43 UTC (permalink / raw)
  To: linux-btrfs; +Cc: Nikolay Borisov

Here is the 3rd submission for the kernel counterpart of the uuid change 
patchset. The only difference is that I (hope) have adressed all cosmetic 
feedback from David as well as have reworded some change logs to ease 
understanding. I've also re-run the regression tests and no failure were 
obsered. 

For background information refer to first posting [0] and the second one [1]

[0] https://lore.kernel.org/linux-btrfs/1535531754-29774-1-git-send-email-nborisov@suse.com/
[1] https://lore.kernel.org/linux-btrfs/1539270244-27076-1-git-send-email-nborisov@suse.com/

Nikolay Borisov (6):
  btrfs: Introduce support for FSID change without metadata rewrite
  btrfs: Remove fsid/metadata_fsid fields from btrfs_info
  btrfs: Add handling for disk split-brain scenario during fsid change
  btrfs: Introduce 2 more members to struct btrfs_fs_devices
  btrfs: Handle one more split-brain scenario during fsid change
  btrfs: Handle final split-brain possibility during fsid change

 fs/btrfs/check-integrity.c      |   2 +-
 fs/btrfs/ctree.c                |   5 +-
 fs/btrfs/ctree.h                |  10 +-
 fs/btrfs/disk-io.c              |  53 ++++++++---
 fs/btrfs/extent-tree.c          |   2 +-
 fs/btrfs/ioctl.c                |   2 +-
 fs/btrfs/super.c                |   2 +-
 fs/btrfs/volumes.c              | 196 ++++++++++++++++++++++++++++++++++++----
 fs/btrfs/volumes.h              |   6 ++
 include/trace/events/btrfs.h    |   2 +-
 include/uapi/linux/btrfs.h      |   1 +
 include/uapi/linux/btrfs_tree.h |   1 +
 12 files changed, 241 insertions(+), 41 deletions(-)

-- 
2.7.4


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

end of thread, other threads:[~2018-10-30 14:43 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-10-11 15:03 [PATCH 0/6] FSID change kernel support Nikolay Borisov
2018-10-11 15:03 ` [PATCH 1/6] btrfs: Introduce support for FSID change without metadata rewrite Nikolay Borisov
2018-10-11 15:03 ` [PATCH 2/6] btrfs: Remove fsid/metadata_fsid fields from btrfs_info Nikolay Borisov
2018-10-11 15:03 ` [PATCH 3/6] btrfs: Add handling for disk split-brain scenario during fsid change Nikolay Borisov
2018-10-11 15:03 ` [PATCH 4/6] btrfs: Introduce 2 more members to struct btrfs_fs_devices Nikolay Borisov
2018-10-11 15:03 ` [PATCH 5/6] btrfs: Handle one more split-brain scenario during fsid change Nikolay Borisov
2018-10-11 15:03 ` [PATCH 6/6] btrfs: Handle final split-brain possibility " Nikolay Borisov
2018-10-19 14:18 ` [PATCH 0/6] FSID change kernel support David Sterba
2018-10-19 14:31   ` Nikolay Borisov
2018-10-19 15:50     ` David Sterba
  -- strict thread matches above, loose matches on Subject: below --
2018-10-30 14:43 [PATCH v3 " Nikolay Borisov
2018-10-30 14:43 ` [PATCH 2/6] btrfs: Remove fsid/metadata_fsid fields from btrfs_info Nikolay Borisov

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