* [PATCH] xfs: move extent busy tree initialization to xfs_initialize_perag
@ 2018-07-31 3:58 Darrick J. Wong
2018-07-31 10:31 ` Brian Foster
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Darrick J. Wong @ 2018-07-31 3:58 UTC (permalink / raw)
To: xfs
From: Darrick J. Wong <darrick.wong@oracle.com>
Move the per-AG busy extent tree initialization to the per-ag structure
initialization since we don't want online repair to leak the old tree.
We only deconstruct the tree at unmount time, so this should be safe.
This also enables us to eliminate the commented out initialization in
the xfsprogs libxfs.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
fs/xfs/libxfs/xfs_alloc.c | 3 ---
fs/xfs/xfs_mount.c | 3 +++
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/fs/xfs/libxfs/xfs_alloc.c b/fs/xfs/libxfs/xfs_alloc.c
index 3c3f2d5119ea..9847c1632712 100644
--- a/fs/xfs/libxfs/xfs_alloc.c
+++ b/fs/xfs/libxfs/xfs_alloc.c
@@ -2755,9 +2755,6 @@ xfs_alloc_read_agf(
pag->pagf_levels[XFS_BTNUM_RMAPi] =
be32_to_cpu(agf->agf_levels[XFS_BTNUM_RMAPi]);
pag->pagf_refcount_level = be32_to_cpu(agf->agf_refcount_level);
- spin_lock_init(&pag->pagb_lock);
- pag->pagb_count = 0;
- pag->pagb_tree = RB_ROOT;
pag->pagf_init = 1;
pag->pagf_agflreset = xfs_agfl_needs_reset(mp, agf);
}
diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c
index 8f739e4d0d1c..99db27d6ac8a 100644
--- a/fs/xfs/xfs_mount.c
+++ b/fs/xfs/xfs_mount.c
@@ -207,6 +207,9 @@ xfs_initialize_perag(
if (xfs_buf_hash_init(pag))
goto out_free_pag;
init_waitqueue_head(&pag->pagb_wait);
+ spin_lock_init(&pag->pagb_lock);
+ pag->pagb_count = 0;
+ pag->pagb_tree = RB_ROOT;
if (radix_tree_preload(GFP_NOFS))
goto out_hash_destroy;
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH] xfs: move extent busy tree initialization to xfs_initialize_perag
2018-07-31 3:58 [PATCH] xfs: move extent busy tree initialization to xfs_initialize_perag Darrick J. Wong
@ 2018-07-31 10:31 ` Brian Foster
2018-07-31 14:53 ` Carlos Maiolino
2018-07-31 15:09 ` Christoph Hellwig
2 siblings, 0 replies; 4+ messages in thread
From: Brian Foster @ 2018-07-31 10:31 UTC (permalink / raw)
To: Darrick J. Wong; +Cc: xfs
On Mon, Jul 30, 2018 at 08:58:12PM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
>
> Move the per-AG busy extent tree initialization to the per-ag structure
> initialization since we don't want online repair to leak the old tree.
> We only deconstruct the tree at unmount time, so this should be safe.
> This also enables us to eliminate the commented out initialization in
> the xfsprogs libxfs.
>
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> ---
Reviewed-by: Brian Foster <bfoster@redhat.com>
> fs/xfs/libxfs/xfs_alloc.c | 3 ---
> fs/xfs/xfs_mount.c | 3 +++
> 2 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/fs/xfs/libxfs/xfs_alloc.c b/fs/xfs/libxfs/xfs_alloc.c
> index 3c3f2d5119ea..9847c1632712 100644
> --- a/fs/xfs/libxfs/xfs_alloc.c
> +++ b/fs/xfs/libxfs/xfs_alloc.c
> @@ -2755,9 +2755,6 @@ xfs_alloc_read_agf(
> pag->pagf_levels[XFS_BTNUM_RMAPi] =
> be32_to_cpu(agf->agf_levels[XFS_BTNUM_RMAPi]);
> pag->pagf_refcount_level = be32_to_cpu(agf->agf_refcount_level);
> - spin_lock_init(&pag->pagb_lock);
> - pag->pagb_count = 0;
> - pag->pagb_tree = RB_ROOT;
> pag->pagf_init = 1;
> pag->pagf_agflreset = xfs_agfl_needs_reset(mp, agf);
> }
> diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c
> index 8f739e4d0d1c..99db27d6ac8a 100644
> --- a/fs/xfs/xfs_mount.c
> +++ b/fs/xfs/xfs_mount.c
> @@ -207,6 +207,9 @@ xfs_initialize_perag(
> if (xfs_buf_hash_init(pag))
> goto out_free_pag;
> init_waitqueue_head(&pag->pagb_wait);
> + spin_lock_init(&pag->pagb_lock);
> + pag->pagb_count = 0;
> + pag->pagb_tree = RB_ROOT;
>
> if (radix_tree_preload(GFP_NOFS))
> goto out_hash_destroy;
> --
> To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] xfs: move extent busy tree initialization to xfs_initialize_perag
2018-07-31 3:58 [PATCH] xfs: move extent busy tree initialization to xfs_initialize_perag Darrick J. Wong
2018-07-31 10:31 ` Brian Foster
@ 2018-07-31 14:53 ` Carlos Maiolino
2018-07-31 15:09 ` Christoph Hellwig
2 siblings, 0 replies; 4+ messages in thread
From: Carlos Maiolino @ 2018-07-31 14:53 UTC (permalink / raw)
To: Darrick J. Wong; +Cc: xfs
On Mon, Jul 30, 2018 at 08:58:12PM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
>
> Move the per-AG busy extent tree initialization to the per-ag structure
> initialization since we don't want online repair to leak the old tree.
> We only deconstruct the tree at unmount time, so this should be safe.
> This also enables us to eliminate the commented out initialization in
> the xfsprogs libxfs.
>
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
> ---
> fs/xfs/libxfs/xfs_alloc.c | 3 ---
> fs/xfs/xfs_mount.c | 3 +++
> 2 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/fs/xfs/libxfs/xfs_alloc.c b/fs/xfs/libxfs/xfs_alloc.c
> index 3c3f2d5119ea..9847c1632712 100644
> --- a/fs/xfs/libxfs/xfs_alloc.c
> +++ b/fs/xfs/libxfs/xfs_alloc.c
> @@ -2755,9 +2755,6 @@ xfs_alloc_read_agf(
> pag->pagf_levels[XFS_BTNUM_RMAPi] =
> be32_to_cpu(agf->agf_levels[XFS_BTNUM_RMAPi]);
> pag->pagf_refcount_level = be32_to_cpu(agf->agf_refcount_level);
> - spin_lock_init(&pag->pagb_lock);
> - pag->pagb_count = 0;
> - pag->pagb_tree = RB_ROOT;
> pag->pagf_init = 1;
> pag->pagf_agflreset = xfs_agfl_needs_reset(mp, agf);
> }
> diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c
> index 8f739e4d0d1c..99db27d6ac8a 100644
> --- a/fs/xfs/xfs_mount.c
> +++ b/fs/xfs/xfs_mount.c
> @@ -207,6 +207,9 @@ xfs_initialize_perag(
> if (xfs_buf_hash_init(pag))
> goto out_free_pag;
> init_waitqueue_head(&pag->pagb_wait);
> + spin_lock_init(&pag->pagb_lock);
> + pag->pagb_count = 0;
> + pag->pagb_tree = RB_ROOT;
>
> if (radix_tree_preload(GFP_NOFS))
> goto out_hash_destroy;
> --
> To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
Carlos
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] xfs: move extent busy tree initialization to xfs_initialize_perag
2018-07-31 3:58 [PATCH] xfs: move extent busy tree initialization to xfs_initialize_perag Darrick J. Wong
2018-07-31 10:31 ` Brian Foster
2018-07-31 14:53 ` Carlos Maiolino
@ 2018-07-31 15:09 ` Christoph Hellwig
2 siblings, 0 replies; 4+ messages in thread
From: Christoph Hellwig @ 2018-07-31 15:09 UTC (permalink / raw)
To: Darrick J. Wong; +Cc: xfs
I don't really understand why you want this, but it does look correct
to me:
Reviewed-by: Christoph Hellwig <hch@lst.de>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-07-31 16:50 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-07-31 3:58 [PATCH] xfs: move extent busy tree initialization to xfs_initialize_perag Darrick J. Wong
2018-07-31 10:31 ` Brian Foster
2018-07-31 14:53 ` Carlos Maiolino
2018-07-31 15:09 ` Christoph Hellwig
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).