> On Aug 16, 2022, at 4:08 PM, Dave Chinner <david@xxxxxxxxxxxxx> wrote: > > On Tue, Aug 16, 2022 at 03:50:46PM -0700, Catherine Hoang wrote: >> Hi all, >> >> I've been working on adding a diagram to document the various logged >> attribute states and their transitions. This is largely based on Dave's >> diagram, with a couple of changes and added details. >> >> The diagram can also be viewed here: >> https://urldefense.com/v3/__https://pasteboard.co/xyGPkCADuH4c.png__;!!ACWV5N9M2RV99hQ!Ie5ew5JxwK3yM7YgVT8e9vzm20GLYKhjpySabyh6ipbZ6i3TGD4K6srKywz40vcQYrvcAafpcKZIdliTv0c$ > > What did you generate this image with? > > i.e. how do we modify it when the state machine changes? We're > already talking about adding multiple attribute modifications being > run through the state machine, so this image will be rapidly out of > date. Hence we need a mechanism to modify the diagram and rebuild > it rather than just committing a binary image file. I used drawio (also open source), but there are many other SVG editors so it doesn’t necessarily require knowledge of one specific tool. Although if folks prefer using plantuml, I’m ok with that as well. Catherine > > The diagram I posted on #xfs was built from a 100-line text source > file with plantuml (open source tool, shipping in at least debian > based distros) and it's pretty trivial to modify and maintain. > > I'd much prefer that we have a slighly less pretty diagram that we > can easily modify and rebuild than a binary image that can't easily > be modified or have the history of changes tracked easily. > > The patch I originally wrote for the diagram is attached below for > reference. > > Cheers, > > Dave. > -- > Dave Chinner > david@xxxxxxxxxxxxx > > > xfs: add LARP state transition diagram source > > From: Dave Chinner <dchinner@xxxxxxxxxx> > > Diagram built with the plantuml gui. Could be built from a CLI > invocation, but this was just a quick hack... > > Signed-off-by: Dave Chinner <dchinner@xxxxxxxxxx> > --- > Documentation/filesystems/xfs-larp-state.txt | 108 +++++++++++++++++++++++++++ > 1 file changed, 108 insertions(+) > > diff --git a/Documentation/filesystems/xfs-larp-state.txt b/Documentation/filesystems/xfs-larp-state.txt > new file mode 100644 > index 000000000000..a02cf018c634 > --- /dev/null > +++ b/Documentation/filesystems/xfs-larp-state.txt > @@ -0,0 +1,108 @@ > +@startuml > + > +state REMOTE_ADD { > + state XFS_DAS_..._SET_RMT { > + } > + state XFS_DAS_..._ALLOC_RMT { > + } > + XFS_DAS_..._SET_RMT --> XFS_DAS_..._ALLOC_RMT > +} > + > +state ADD { > + state add_entry <<entryPoint>> > + state add_form <<choice>> > + add_entry --> add_form > + add_form --> XFS_DAS_SF_ADD : short form > + add_form --> XFS_DAS_LEAF_ADD : leaf form > + add_form --> XFS_DAS_NODE_ADD : node form > + state XFS_DAS_SF_ADD { > + } > + state XFS_DAS_LEAF_ADD { > + } > + state XFS_DAS_NODE_ADD { > + } > + > + XFS_DAS_SF_ADD --> XFS_DAS_LEAF_ADD : Full or too large > + XFS_DAS_LEAF_ADD --> XFS_DAS_NODE_ADD : full or too large > + > + XFS_DAS_LEAF_ADD --> XFS_DAS_..._SET_RMT : remote xattr > + XFS_DAS_NODE_ADD --> XFS_DAS_..._SET_RMT : remote xattr > + > +} > + > +state REMOVE { > + state remove_entry <<entryPoint>> > + state remove_form <<choice>> > + remove_entry --> remove_form > + remove_form --> XFS_DAS_SF_REMOVE : short form > + remove_form --> XFS_DAS_LEAF_REMOVE : leaf form > + remove_form --> XFS_DAS_NODE_REMOVE : node form > + state XFS_DAS_SF_REMOVE { > + } > + state XFS_DAS_LEAF_REMOVE { > + } > + state XFS_DAS_NODE_REMOVE { > + } > + > +} > + > +state REPLACE { > + state replace_choice <<choice>> > + replace_choice --> add_entry : larp disable > + replace_choice --> remove_entry : larp enabled > +} > + > + > +state OLD_REPLACE { > + state XFS_DAS_..._REPLACE { > + state XFS_DAS_..._REPLACE : atomic INCOMPLETE flag flip > + } > + state XFS_DAS_..._REMOVE_OLD { > + state XFS_DAS_..._REMOVE_OLD : restore original xattr state for remove > + state XFS_DAS_..._REMOVE_OLD : invalidate old xattr > + } > + XFS_DAS_..._REPLACE --> XFS_DAS_..._REMOVE_OLD > + > +} > + > +state add_done <<choice>> > +add_done -down-> XFS_DAS_DONE : Operation Complete > +add_done -up-> XFS_DAS_..._REPLACE : LARP disabled REPLACE > +XFS_DAS_SF_ADD -down-> add_done : Success > +XFS_DAS_LEAF_ADD -down-> add_done : Success > +XFS_DAS_NODE_ADD -down-> add_done : Success > +XFS_DAS_..._ALLOC_RMT -down-> add_done : Success > + > +state remove_done <<choice>> > +remove_done -down-> XFS_DAS_DONE : Operation Complete > +remove_done -up-> add_entry : LARP enabled REPLACE > +XFS_DAS_SF_REMOVE -down-> remove_done : Success > +XFS_DAS_LEAF_REMOVE -down-> remove_done : Success > +XFS_DAS_NODE_REMOVE -down-> remove_done : Success > +XFS_DAS_..._REMOVE_ATTR -down-> remove_done : Success > + > +state REMOVE_XATTR { > + state remove_xattr_choice <<choice>> > + remove_xattr_choice --> XFS_DAS_..._REMOVE_RMT : Remote xattr > + remove_xattr_choice --> XFS_DAS_..._REMOVE_ATTR : Local xattr > + state XFS_DAS_..._REMOVE_RMT { > + } > + state XFS_DAS_..._REMOVE_ATTR { > + } > + XFS_DAS_..._REMOVE_RMT --> XFS_DAS_..._REMOVE_ATTR > +} > +XFS_DAS_..._REMOVE_OLD --> remove_xattr_choice > +XFS_DAS_NODE_REMOVE --> remove_xattr_choice > + > + > +state XFS_DAS_DONE { > +} > + > +state set_choice <<choice>> > + > +[*] --> set_choice > +set_choice --> add_entry : add new > +set_choice --> remove_entry : remove existing > +set_choice --> replace_choice : replace existing > +XFS_DAS_DONE --> [*] > +@enduml