From mboxrd@z Thu Jan 1 00:00:00 1970 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 B0786C433F5 for ; Thu, 6 Oct 2022 00:14:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229744AbiJFAOs (ORCPT ); Wed, 5 Oct 2022 20:14:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33686 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229761AbiJFAOp (ORCPT ); Wed, 5 Oct 2022 20:14:45 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EDF14F007 for ; Wed, 5 Oct 2022 17:14:41 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 53D8261750 for ; Thu, 6 Oct 2022 00:14:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9B45EC433C1; Thu, 6 Oct 2022 00:14:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1665015280; bh=S4trj1xYx8O/tUXmG7bwiz8nYXtKDgZaPkGel3C9V+w=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Yl9vcnLV7MrUFLaMNYcuWW0ECODTm+TqGBZOYJoA6ZOSl08NaHcoCPnq/lMayvfq7 GsfE0+oS4qnwgmZitM6s5zrDYVcGXJF8UrPZHcvUXjaHLUtZAUYHH/NjehERxQNkJS tXFVilCvWq0mLkn2I/dzymA2gaMPPvsNBpcYJTFFljFhSWD5/UYJdWXQakdq7fUW7s j/ygWYFB4uvedNjpGJy76HARPL/BSyOXETzDVFrDam5XoYDqxtIOlbrSjtK6ZLkDaM ERXdUBPWqAWWQe88rAhu0uWM4prCqqGVb7GUzlgCEVMpyEZ3sVMuyjcIjLTaN+IlMa HZr+/yc2DbnNg== Date: Wed, 5 Oct 2022 17:14:40 -0700 From: "Darrick J. Wong" To: Catherine Hoang Cc: linux-xfs@vger.kernel.org Subject: Re: [PATCH v3] xfs: add LARP state transition diagram Message-ID: References: <20221005233801.1731-1-catherine.hoang@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221005233801.1731-1-catherine.hoang@oracle.com> Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org On Wed, Oct 05, 2022 at 04:38:01PM -0700, Catherine Hoang wrote: > From: Dave Chinner > > 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. > > [cathhoan: add descriptions, links to docs, and diagram image] > > Signed-off-by: Dave Chinner > Signed-off-by: Catherine Hoang > Reviewed-by: Allison Henderson > --- > Documentation/filesystems/xfs-larp-state.pu | 103 ++++++++ > Documentation/filesystems/xfs-larp-state.svg | 253 +++++++++++++++++++ How did you get it to pretty-print the svg? This looks great! I think the next step is to link this into the rest of the documentation, but that's a separate patch. Reviewed-by: Darrick J. Wong --D > 2 files changed, 356 insertions(+) > create mode 100644 Documentation/filesystems/xfs-larp-state.pu > create mode 100644 Documentation/filesystems/xfs-larp-state.svg > > diff --git a/Documentation/filesystems/xfs-larp-state.pu b/Documentation/filesystems/xfs-larp-state.pu > new file mode 100644 > index 000000000000..7a54773665a6 > --- /dev/null > +++ b/Documentation/filesystems/xfs-larp-state.pu > @@ -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 > diff --git a/Documentation/filesystems/xfs-larp-state.svg b/Documentation/filesystems/xfs-larp-state.svg > new file mode 100644 > index 000000000000..860fe2b59093 > --- /dev/null > +++ b/Documentation/filesystems/xfs-larp-state.svg > @@ -0,0 +1,253 @@ > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + REMOTE_ADD > + > + > + > + > + ADD > + > + > + > + > + REMOVE > + > + > + > + > + REPLACE > + > + > + > + > + OLD_REPLACE > + > + > + > + > + REMOVE_XATTR > + > + > + XFS_DAS_..._SET_RMT > + find space for remote blocks > + > + > + XFS_DAS_..._ALLOC_RMT > + allocate blocks and set remote value > + > + > + 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 > + add_entry > + > + > + > + > + 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 > + (attr exists and blocks are valid) > + remove_entry > + > + > + > + > + > + XFS_DAS_..._REPLACE > + atomic INCOMPLETE flag flip > + > + > + XFS_DAS_..._REMOVE_OLD > + restore original xattr state for remove > + invalidate old xattr > + > + > + XFS_DAS_..._REMOVE_RMT > + remove remote attribute blocks > + > + > + XFS_DAS_..._REMOVE_ATTR > + remove attribute name from leaf/node block > + > + > + > + > + > + > + > + > + > + XFS_DAS_DONE > + > + > + > + > + > + > + > + > + > + short form > + > + > + > + leaf form > + > + > + > + node form > + > + > + > + Full or too large > + > + > + > + full or too large > + > + > + > + remote xattr > + > + > + > + remote xattr > + > + > + > + > + > + > + short form > + > + > + > + leaf form > + > + > + > + node form > + > + > + > + larp disable > + > + > + > + larp enabled > + > + > + > + > + > + > + Remote xattr > + > + > + > + Local xattr > + > + > + > + > + > + > + Operation Complete > + > + > + > + LARP disabled REPLACE > + > + > + > + Success > + > + > + > + Success > + > + > + > + Success > + > + > + > + Success > + > + > + > + Operation Complete > + > + > + > + LARP enabled REPLACE > + > + > + > + Success > + > + > + > + Success > + > + > + > + Success > + > + > + > + Success > + > + > + > + > + > + > + > + > + > + > + > + > + add new > + > + > + > + remove existing > + > + > + > + replace existing > + > + > + > + > + > -- > 2.25.1 >