Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0EB0AC07E9D for ; Sat, 24 Sep 2022 00:56:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232315AbiIXA4C (ORCPT ); Fri, 23 Sep 2022 20:56:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35402 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229600AbiIXA4A (ORCPT ); Fri, 23 Sep 2022 20:56:00 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2BCC311E959 for ; Fri, 23 Sep 2022 17:55:57 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id B3001B81E73 for ; Sat, 24 Sep 2022 00:55:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 419E1C433C1; Sat, 24 Sep 2022 00:55:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1663980954; bh=6dCsKoNqrqFmO4cYDj8e8lQg+vFgDCeNLYaTuUB2jcw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=W3RuUkWAPu62aD4sbkgt6SQUHoPfooHew3LoX1WM3QC8QHCc4SyHQXIJ4kVAtBeMC 2hFC90L0dvUbUllaGLBIrtWvEtcEFSK5snLhzb+cWLEFg5cp/JdRZaljN3P8p4IkLr t3pw+wMbaNFYZUjLYuQ9NrmgP7c7P0Zxkn7akEAIr2qETEDrul9ptfhnr8+WyYqb+O TFuqfcDaK5MtMKhEY5ejQ73ZkByfKQtR+w9VKQ5ty4pauzUuGjaflBMC3zIssuJG6S mrCsXvvLsOeTBKdqyruK3yB8zpdcXsh/UHw+Dw5/XoMp3WXBJEkCpcYVtPxVsuEqAE s4UVnkL8Z1AYQ== Date: Fri, 23 Sep 2022 17:55:53 -0700 From: "Darrick J. Wong" To: Catherine Hoang Cc: linux-xfs@vger.kernel.org Subject: Re: [PATCH v2] xfs: add LARP state transition diagram Message-ID: References: <20220830232022.55523-1-catherine.hoang@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <20220830232022.55523-1-catherine.hoang@oracle.com> Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org On Tue, Aug 30, 2022 at 04:20:22PM -0700, Catherine Hoang wrote: > From: Dave Chinner >=20 > Add a state transition diagram documenting each logged attribute state > and their transition conditions. The diagram can be built from the > included text source file with PlantUML. >=20 > [cathhoan: add descriptions, links to docs, and diagram image] >=20 > Signed-off-by: Dave Chinner > Signed-off-by: Catherine Hoang > --- > Documentation/filesystems/xfs-larp-state.svg | 1 + Oh wow that's all one line? Er.. does the plantuml gui have a means to spit out prettyfied svg? > Documentation/filesystems/xfs-larp-state.txt | 103 +++++++++++++++++++ /me wonders if this should be .pu and not .txt, but otherwise I'm mostly ok with it. --D > 2 files changed, 104 insertions(+) > create mode 100644 Documentation/filesystems/xfs-larp-state.svg > create mode 100644 Documentation/filesystems/xfs-larp-state.txt >=20 > diff --git a/Documentation/filesystems/xfs-larp-state.svg b/Documentation= /filesystems/xfs-larp-state.svg > new file mode 100644 > index 000000000000..d93078300d91 > --- /dev/null > +++ b/Documentation/filesystems/xfs-larp-state.svg > @@ -0,0 +1 @@ > +REMOTE_ADD= ADDREMOVEREPLACEOLD_REPLACEREMOVE_XATTRXFS_DAS_..._SET_RMTfind space for remote blocks<= rect fill=3D"#FEFECE" filter=3D"url(#fc2ynpqha1fpc)" height=3D"50.2656" rx= =3D"12.5" ry=3D"12.5" style=3D"stroke: #A80036; stroke-width: 1.5;" width= =3D"252" x=3D"204" y=3D"1090"/>XFS_DAS_..._AL= LOC_RMTallocate blocks and set remote valueXFS_DAS_SF_ADDadd attr to short= form forkXFS_DAS_LEAF_ADDadd attr to inode in leaf formXFS_DAS_NODE_ADDadd attr to node form= at attribute treeadd_entryXFS_DAS_SF_R= EMOVEremove attr from shortform forkXFS_DAS_LEAF_REMOVEremove attr from an= inode in leaf formXFS_DAS_NODE_REMOVEsetup for removal(attr exists and b= locks are valid)remove_entryXFS_DAS_..._REPLACEatomic INCOMPLETE flag flipXFS_DAS_..._REMOVE_OL= Drestore original xattr state for removeinvalidate old xattr= XFS_DAS_..._REM= OVE_RMTremove remote attribute blocksXFS_DAS_..._REMOVE_ATTRremove attribute na= me from leaf/node blockXFS_DAS_DONEshort formleaf formnode form<= !--link XFS_DAS_SF_ADD to XFS_DAS_LEAF_ADD-->Full or too largefull or = too largeremote xat= trremote xattrshort formleaf formnode formlarp = disablelarp enabledRemote xattr<= polygon fill=3D"#A80036" points=3D"1106.82,960.87,1113.5521,953.6812,1108.4= 609,956.1469,1105.9952,951.0557,1106.82,960.87" style=3D"stroke: #A80036; s= troke-width: 1.0;"/>Local xattrOperatio= n CompleteLARP disabled REPLACESuccessSuccess= SuccessSuccess<= !--link remove_done to XFS_DAS_DONE-->Op= eration CompleteLARP ena= bled REPLACE= SuccessSuccessSuccessSuccessadd newremove existin= greplace existing > \ No newline at end of file > diff --git a/Documentation/filesystems/xfs-larp-state.txt b/Documentation= /filesystems/xfs-larp-state.txt > new file mode 100644 > index 000000000000..7a54773665a6 > --- /dev/null > +++ b/Documentation/filesystems/xfs-larp-state.txt > @@ -0,0 +1,103 @@ > +/' > +PlantUML documentation: > +Getting started - https://plantuml.com/starting > +State diagram - https://plantuml.com/state-diagram > +'/ > + > +@startuml > + > +state REMOTE_ADD { > + XFS_DAS_..._SET_RMT : find space for remote blocks > + XFS_DAS_..._ALLOC_RMT : allocate blocks and set remote value > + > + XFS_DAS_..._SET_RMT --> XFS_DAS_..._ALLOC_RMT > +} > + > +state ADD { > + XFS_DAS_SF_ADD : add attr to shortform fork > + XFS_DAS_LEAF_ADD : add attr to inode in leaf form > + XFS_DAS_NODE_ADD : add attr to node format attribute tree > + > + state add_entry <> > + state add_form <> > + 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 > + > + 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 { > + XFS_DAS_SF_REMOVE : remove attr from shortform fork > + XFS_DAS_LEAF_REMOVE : remove attr from an inode in leaf form > + XFS_DAS_NODE_REMOVE : setup for removal > + XFS_DAS_NODE_REMOVE : (attr exists and blocks are valid) > + > + state remove_entry <> > + state remove_form <> > + 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 REPLACE { > + state replace_choice <> > + replace_choice --> add_entry : larp disable > + replace_choice --> remove_entry : larp enabled > +} > + > + > +state OLD_REPLACE { > + XFS_DAS_..._REPLACE : atomic INCOMPLETE flag flip > + XFS_DAS_..._REMOVE_OLD : restore original xattr state for remove > + XFS_DAS_..._REMOVE_OLD : invalidate old xattr > + > + XFS_DAS_..._REPLACE --> XFS_DAS_..._REMOVE_OLD > +} > + > +state REMOVE_XATTR { > + XFS_DAS_..._REMOVE_RMT : remove remote attribute blocks > + XFS_DAS_..._REMOVE_ATTR : remove attribute name from leaf/node block > + > + state remove_xattr_choice <> > + remove_xattr_choice --> XFS_DAS_..._REMOVE_RMT : Remote xattr > + remove_xattr_choice --> XFS_DAS_..._REMOVE_ATTR : Local xattr > + > + XFS_DAS_..._REMOVE_RMT --> XFS_DAS_..._REMOVE_ATTR > +} > + > +state XFS_DAS_DONE { > +} > + > +state add_done <> > +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 <> > +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 > + > +XFS_DAS_..._REMOVE_OLD --> remove_xattr_choice > +XFS_DAS_NODE_REMOVE --> remove_xattr_choice > + > +state set_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 > --=20 > 2.25.1 >=20