On Fri, Oct 19, 2018 at 05:31:09PM +0300, Nikolay Borisov wrote: > > > On 19.10.2018 17:18, David Sterba wrote: > > On Thu, Oct 11, 2018 at 06:03:20PM +0300, Nikolay Borisov wrote: > >> 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. > > > > All the cases seem to be covered. Do you intend to add the design > > document somewhere? The references in the code seem stale and puzzling. > > I believe I have the critical portions of the design document (i.e the > handling of various cases) described in each of the 3 patches that add > split-brain handling. The doc could be added to the btrfs-dev-doc repo I > guess.
Yeah, but what does 4/a mean in the comments? It's not referring to the changelog where I'd look first. External documentation is fine but we need some sort of reference in the code. The comments in 5/6 and 6/6 are sufficient, just that the references could be more explicit. Possibly the cases can be simplified and put into the .c as a bullet list. The document is good for understanding, the nice-to-have part would be some quick reference to check the logic. I'll give it another read to see how much is really missing or not.